wdpr
    Preparing search index...

    Runtime module for mathematical notation interaction and polyfill.

    Provides two features:

    1. MathML polyfill -- detects whether the browser supports MathML natively. If not, dynamically imports the hfmath library to render LaTeX as SVG, using the hidden .math-source elements as the LaTeX source.

    2. Equation reference interaction -- handles hover tooltips and click-to-scroll for [[eref]] elements, showing a preview of the referenced equation on hover and smooth-scrolling to the equation on click.

    DOM interactions:

    • Listens for mouseenter (capture) on .eref to show equation tooltip
    • Listens for mouseleave (capture) on .eref to hide tooltip
    • Listens for click (capture) on .eref-link to scroll to the equation
    • On browsers without MathML: queries .math-render and .math-source to apply SVG polyfill

    The destroy() cleanup function removes all three event listeners.

    Functions

    initMath