How to use the mathjax-full/js/core/MathItem.js.STATE function in mathjax-full

To help you get started, we’ve selected a few mathjax-full examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathjax / MathJax-demos-node / speech / action.js View on Github external
require('mathjax-full/js/util/asyncLoad/node.js');
require('mathjax-full/js/a11y/semantic-enrich.js');
const STATE = require('mathjax-full/js/core/MathItem.js').STATE;

//
//  Remove the data-semantic-* attributes other than data-semantic-speech
//
function removeSemanticData(math) {
    math.root.walkTree(node => {
        const attributes = node.attributes.getAllAttributes();
        delete attributes.xmlns;    // some internal nodes get this attribute for some reason
        for (const name of Object.keys(attributes)) {
            if (name.substr(0, 14) === 'data-semantic-' && name !== 'data-semantic-speech') {
                delete attributes[name];
            }
        }
    });
}

mathjax-full

Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers and in server-side node applications. This package includes the source code as well as

Apache-2.0
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis