Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (name.substr(0, 14) === 'data-semantic-' && name !== 'data-semantic-speech') {
delete attributes[name];
}
}
});
}
//
// The renderActions needed to remove the data-semantic-attributes.
// STATE.ENRICHED is the priority of the enrichment, so this will rung just after enrichment.
// The first function is the one for when the document's render() method is called.
// The second is for when a MathItem's render(), rerender() or convert() method is called.
//
exports.speechAction = {
simplfy: [
STATE.ENRICHED + 1,
(doc) => {
for (const math of doc.math) {
removeSemanticData(math);
}
},
(math, doc) => {
removeSemanticData(math);
}
]
};