4 ms·
How hard would it be to export a flat HTML version of the rendered document? Extract the DOM somehow, discard the react-specifics, ...? Or would it be easier to
by detaro 11y ago
How hard would it be to export a flat HTML version of the rendered document? Extract the DOM somehow, discard the react-specifics, ...? Or would it be easier to push the Markdown into a dedicated renderer?
EDIT: thanks at fiatjaf for mentioning alternatives, Dillinger has HTML export already.
- couac 11y agommh, it would be relatively easy but why would you do that? I'd be glad to know your use case.
- detaro 11y agoWrite HTML files to share online. If you use Markdown, you always need a conversion somewhere, PDFs are big and slow, ... HTML file I can do basic formatting, throw some default CSS on it and it looks and feels good on basically any device, can be e-mailed, ...
- couac 11y agoMakes perfectly sense, thanks!
- 8note 11y agoThat's basically server side rendering; ReactDOMServer.renderToStaticMarkup would do it? I on't know if it affects a real DOM though; it might have weird side effects on the app.