News for hackers. Stuff that matters.
Re:Strapdown.js – Instant and elegant Markdown documents by spankalee on Friday June 15, 2018 @04:38PM (#17323348)
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...

For math, you can do a similar thing with Katex: https://github.com/justinfagnani/katex-elements

    <katex-display>c = \pm\sqrt{a^2 + b^2}</katex-display>

There are no comments on this comment yet.