3 ms·
I think this kind of thing is a bit more straightforward with Web Components, especially since the generated HTML can be rendered to Shadow DOM. The PolymerEle
by spankalee 8y ago
I think this kind of thing is a bit more straightforward with Web Components, especially since the generated HTML can be rendered to Shadow DOM.
The PolymerElement project's <marked-element> has offered declarative client-side Markdown for years:
<marked-element>
<!-- content is in a script tag so inline HTML isn't instantiated -->
<script type="text/markdown">
# Hello
</script>
</marked-element>
https://www.webcomponents.org/element/PolymerElements/marked-element https://www.webcomponents.org/element/PolymerElements/marked...
For math, you can do a similar thing with Katex: https://github.com/justinfagnani/katex-elements https://github.com/justinfagnani/katex-elements
<katex-display>c = \pm\sqrt{a^2 + b^2}</katex-display>