3 ms·
I love that this publishes the <math-up> web component. It's a great way to take content that's actually pretty humanly readable in the HTML, and translate it
by spankalee 2y ago
I love that this publishes the <math-up> web component.
It's a great way to take content that's actually pretty humanly readable in the HTML, and translate it to an even better rendered format in the UI. It's good for progressive enhancement and framework support at the same time.
- runarberg 2y agoAnother nice thing about web components is that you can sniff the custom element registry (and even await a promised registration) for custom elements. I was writing a couple of markdown-it plugins yesterday[1][2] to render $dollar delimited math$ and simply places its content in either a <math-up> or a <la-tex>[3] element depending on what is already in the custom element registry. Meaning if you want to write LaTeX rather than AsciiMath all you have to do is import the webcomponent before you call the markdown-it render. 1: https://github.com/runarberg/markdown-it-mathblock https://github.com/runarberg/markdown-it-mathblock 2: https://github.com/runarberg/markdown-it-mathspan https://github.com/runarberg/markdown-it-mathspan 3: https://github.com/runarberg/temml-custom-element https://github.com/runarberg/temml-custom-element