-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Support HTML comment nodes #8822
Comments
Handling HTML comments won't be trivial, so we need to split this task. Cases to be handled:
|
Meeting notes. HTML comments kickoff (01.04.2021)
How to represent comments in the model?
How to represent comments in the view (downcast)?
How to represent comments in the view (upcast)?
Position mapping<paragraph><$text bold=true>Foo</$text></paragraph>
<p><$comment />Foo</p> How will mapping the model's Foo position to the view's Foo text node work? The $comment element changes the indexes in the view. But the same situation happens on markerToData(). How does it work there? Probably, we just need to copy the same solution. Tada: markerToData() uses UIElement. So, we already use UIElements in the data view. Delivery
|
Feature (html-support): Introduced the HTML comment plugin. Closes #8822. Other (engine): Undeprecated the `elementToMarker` upcast helper. Feature (engine): Introduced new option `skipComments` in `DomConverter#domToView()` (`false` by default) to make it possible to decide whether HTML comments should be removed from the data. Internal (paste-from-office): Removed all HTML comments from pasted data. Fix (table): Fixed model mappings in table cell if a paragraph is bound to its parent.
📝 Provide a description of the new feature
Currently, if your editor data will include an HTML comment, it will get removed.
Steps to reproduce:
editor.setData( '<p>foo bar<!-- aa --></p><!-- bb -->' ); console.log( editor.getData() );
Expected:
<p>foo bar<!-- aa --></p><!-- bb -->
should be logged.Actual:
<p>foo bar</p>
We got a use case where CKEditor 4 integrators used HTML comments to include some metadata, like page number etc.
If you'd like to see this feature implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: