lexical
lexical copied to clipboard
Bug: highlight TextFormatType is missing in importDOM losing state
Pull request https://github.com/facebook/lexical/pull/3583 by @moy2010 added a new textformat (which is helpful), but if we use HTML to serialize it gets lost because importDOM is not parsing the mark tag in https://github.com/facebook/lexical/blob/20e4ea1687bd846653a0cc2df8cbb610d8308307/packages/lexical/src/nodes/LexicalTextNode.ts#L552
Also the devtools do not show formatting for this new highlight feature because its mising in https://github.com/facebook/lexical/blob/20e4ea1687bd846653a0cc2df8cbb610d8308307/packages/lexical-devtools-core/src/generateContent.ts#L58
Lexical version: 0.16.1
Steps To Reproduce
- exportDOM a TextNode with format highlighting
- importDOM mark does not get parsed back to highligted text.,
This would be a straightforward PR to write if you were interested, or you could override the importDOM using the html property of your EditorConfig if you needed a solution that would work without upgrading lexical. It doesn't look like any code in the monorepo is using IS_HIGHLIGHT which is likely why it was forgotten here.