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

Certain markup breaks the Source Editing mode #11429

Merged
merged 1 commit into from
Mar 8, 2022
Merged

Certain markup breaks the Source Editing mode #11429

merged 1 commit into from
Mar 8, 2022

Conversation

psmyrek
Copy link
Contributor

@psmyrek psmyrek commented Mar 8, 2022

Suggested merge commit message (convention)

Fix (html-support): Skip inline image upcast conversion inside not supported element. Closes #10703.

@psmyrek
Copy link
Contributor Author

psmyrek commented Mar 8, 2022

It was quite difficult for me to find out what is going on here. Below there are some notes I was able to find out while debugging this problem:

  • The DataFilter#_registerElementHandlers() registers converters based on the type of a given element. But if a given element is both an object and an inline type, then $text will not be extended with new attributes introduced by this element. Is this approach correct? Probably yes, as they will be stored in the htmlAttributes attribute, but it was a surprise to me a bit.
  • Initially, I wanted to fix this issue in another way. If an element is an object and an inline type (there are several such elements, i.e. htmlImg), then we should additionally register attribute converters by calling the DataFilter#_registerInlineElement() for this element. This, however, would not be enough because the upcast converter from image integration is called before the default converter for inline elements, so the one from the image integration had to be reordered with 'low' - 1 priority. In the end, I decided that it is too complicated and the current fix in this PR seems to be enough.

@arkflpc arkflpc self-requested a review March 8, 2022 12:41
@arkflpc arkflpc merged commit 9f6e48a into master Mar 8, 2022
@arkflpc arkflpc deleted the ck/10703 branch March 8, 2022 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Certain markup breaks the Source Editing mode
2 participants