Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The link rel attribute should be handled as a token list to allow mixing manual link decorators for the same attribute #17461

Open
wants to merge 61 commits into
base: master
Choose a base branch
from

Conversation

niegowski
Copy link
Contributor

@niegowski niegowski commented Nov 14, 2024

Suggested merge commit message (convention)

Fix (engine): The link rel attribute will now allow mixing manual link decorators for the same attribute, as it will be now handled as a token list. Closes #13985, closes #6436.

Fix (mention): Mention should not be wrapped with an additional <span> when GHS is enabled. Closes #15329.

Internal (html-support): Attribute matching updated to the new output of Matcher#matchAll().

MINOR BREAKING CHANGE (engine): The ViewConsumable.consumablesFromElement() is removed and replaced with view.Element#_getConsumables() internal method. You should use ViewConsumable.createFrom() To create consumables if needed.

MINOR BREAKING CHANGE (engine): The ViewElementConsumables now accepts and outputs only normalized data. The ViewConsumable still accepts normalized or non-normalized input.

MINOR BREAKING CHANGE (engine): The Matcher#match() and Matcher#matchAll() output is now normalized. The MatchResult#match now contains normalized data compatible with changes in the ViewConsumable.


Additional information

For example – encountered issues, assumptions you had to make, other affected tickets, etc.

…of attributes like class, style, rel or plain attribute.
@niegowski niegowski marked this pull request as ready for review December 17, 2024 14:33
@Witoso
Copy link
Member

Witoso commented Dec 17, 2024

@niegowski added closes #6436 as I think we mentioned it fixes this one as well.

@Witoso
Copy link
Member

Witoso commented Dec 17, 2024

Before merging, let's discuss the release strategy, if it's coupled or not with linking experience.

Copy link
Contributor

@scofalik scofalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard for me to approach this PR from top-level point of view and decide whether it is the best way to do it, but in overall, it makes sense and looks good. I rather focused on particular bits of code and possible logical/algorithmical/typo errors.

My two questions marks are:

  1. I am not sure if it was a good decision to move some of the code to view elements. I mean generating consumables and merging elements. I don't know what was the reason to move it (e.g. if multiple parts of the code wanted to perform the same logic and view element was the best to keep it). If you decide that this is a must have, I'd recommend taking care to see if all related elements are moved. In one place I commented that it is weird that view element imports a type from conversion. I had such feeling a few times. Right now I am not convinced that moving code to view elements was a necessary change, but I don't have the holistic view on this PR/improvement, you spent more time on it.
  2. Performance. Could you confirm that the performance does not drop, especially for samples where there is a lot of merging and unwrapping of view attribute elements (formattingLongPs, inlineStyles, wiki, ghs from the recently introduced performance tests).

packages/ckeditor5-engine/src/conversion/viewconsumable.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/conversion/viewconsumable.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/conversion/viewconsumable.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/view/element.ts Show resolved Hide resolved
packages/ckeditor5-engine/src/view/element.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/view/element.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/view/element.ts Show resolved Hide resolved
packages/ckeditor5-engine/src/view/element.ts Outdated Show resolved Hide resolved
@niegowski niegowski requested a review from scofalik January 24, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants