Closed jadsongmatos closed 2 years ago
@jadsongmatos
If you already have the blocks, it would be much easier to maintain a copy of the same. And, use editorjs-html to convert them only when you need to render blocks on a webpage.
However, if you have raw HTML that you need to convert to editorjs styled blocks. You'll first need to parse html by using some DOM library such as jsdom, traverse through the document nodes, and write suitable parsers for converting html elements to different JSON blocks.
I needed a way to convert html to js editor blocks, one way around this was to add an individual element to the end of the html containing json with blocks.