You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The currently exported HTML would contain theme classes, which in many cases would mean something only to the current application that provides them in its theme configuration and add no meaningful value to any external copy/paste use case. Since the classes would be reapplied on editor state reparsing. It makes sense to allow skipping the export of the 'class' attribute when generating the HTML. It also has benefit in terms of smaller HTML footprint for storage, for those that store the HTML instead of the EditorState.
Edit: I do think, we should keep the 'style' attribute or make it extra configurable and not couple 'class' and 'style' together.
The text was updated successfully, but these errors were encountered:
Maybe what we should do is have a more flexible system for configuring this kind of thing across the board. The EditorConfig allows you to specify one set of html.export configurations but maybe your app has multiple use cases for exportDOM (serialization, copy/paste, rendering an inert editor, some other export use case). Some kind of config argument that contains this intent enum (like excludeFromCopy, but actually implemented consistently) that's passed to exportDOM would be helpful. For export map override we could have an additional option passed to call the default implementation kinda like middleware since node.exportDOM may have an override already in EditorConfig.
Another thing to assist with this use case would be returning DOM instead of an HTML string so the user could querySelectorAll a quick solution to this for their use case.
Lexical: 0.21
lexical/packages/lexical-html/src/index.ts
Lines 67 to 90 in ddd0903
The currently exported HTML would contain theme classes, which in many cases would mean something only to the current application that provides them in its theme configuration and add no meaningful value to any external copy/paste use case. Since the classes would be reapplied on editor state reparsing. It makes sense to allow skipping the export of the 'class' attribute when generating the HTML. It also has benefit in terms of smaller HTML footprint for storage, for those that store the HTML instead of the EditorState.
Edit: I do think, we should keep the 'style' attribute or make it extra configurable and not couple 'class' and 'style' together.
The text was updated successfully, but these errors were encountered: