Interprets a template literal as MathML fragment that can efficiently render
to and update a container.
constnum = mathml`<mn>1</mn>`;
consteq = html` <math> ${num} </math>`;
The mathmltag function should only be used for MathML fragments, or
elements that would be contained inside a <math> HTML element. A common
error is placing a <math>element in a template tagged with the mathml
tag function. The <math> element is an HTML element and should be used
within a template tagged with the html tag function.
In LitElement usage, it's invalid to return an MathML fragment from the
render() method, as the MathML fragment will be contained within the
element's shadow root and thus not be properly contained within a <math>
HTML element.
Interprets a template literal as MathML fragment that can efficiently render to and update a container.
The
mathml
tag function should only be used for MathML fragments, or elements that would be contained inside a<math>
HTML element. A common error is placing a<math>
element in a template tagged with themathml
tag function. The<math>
element is an HTML element and should be used within a template tagged with thehtml
tag function.In LitElement usage, it's invalid to return an MathML fragment from the
render()
method, as the MathML fragment will be contained within the element's shadow root and thus not be properly contained within a<math>
HTML element.