3 ms·
Another 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 wr
by runarberg 2y ago
Another 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