I want to open edit an HTML file with ProseMirror, but I don’t want to load the html into the DOM for security reasons. Preferably ProseMirror would parse the HTML text into its JSON representation and thus only render secure content.
It looks like prosemirror-markdown uses markdown-it to parse directly into the JSON format… So I guess I should mention that I’m just using the prosemirror-example-setup. Perhaps this doesn’t exist yet?
Causing some pain again – HTMLElement is not defined… It appears node: string | Node. So I cant just check for typeof node !== "string". Since HTMLElement inherits from Node, I need to actually check the instanceof for TypeScript to be happy…