We're integrating the BlockNote WYSIWYG editor in XWiki by reusing its integration in Cristal. Unlike other WYSIWYG editors, BlockNote doesn't use HTML as input / output syntax. It uses its own custom syntax to represent the editable blocks of content. The Cristal project has integrated BlockNote and implemented a more generic UniAst syntax (that gets converted to / from the BlockNote's own syntax). In my current implementation for XWIKI-23025 I'm using Markdown as input / output for the editor, because:
- XWiki has an extension that adds support for the Markdown syntax to the XWiki rendering (server-side)
- Cristal provides utilities to convert between Markdown and UniAst (client-side)
But this means my code needs to:
- depend on the Markdown extension, server-side
- bundle the Markdown utility code in the generated client-side code
It would be faster, simpler and with fewer chances of losing stuff in translation if we introduce a parser / renderer server-side for the UniAst syntax, i.e. to go directly from UniAst to XDOM instead of going through Markdown. |