Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mathjax-node-sre
Advanced tools
This module extends mathjax-node using speech-rule-engine.
It can be used as a drop-in replacement for mathjax-node.
Use
npm install mathjax-node-sre
to install mathjax-node-sre and its dependencies.
mathjax-node-sre provides three features.
mathjax-node-sre can be used as a drop-in replacement of mathjax-node, so just import start
, config
, and typeset
as you would with mathjax-node.
In addition to the usual mathjax-node configuration options, mathjax-node-sre accepts
speakText: false, // adds spoken annotations to output
speakRuleset: "mathspeak", // set speech ruleset; default (= chromevox rules) or mathspeak
speakStyle: "default", // set speech style for mathspeak rules: default, brief, sbrief)
semantic: false, // adds semantic tree information to output
minSTree: false, // if true the semantic tree is minified
enrich: false // replace the math input with MathML resulting from SRE enrichment
speech: 'deep' // sets depth of speech; 'shallow' or 'deep'
mathjax-node-sre provides a postprocessor
which expects mathjax-node output together with a configuration object containing the above options (except enrich
) to add speech-text to mathjax-node output.
For example,
const mj = require('mathjax-node').typeset;
const postprocessor = require('mathjax-node-sre').postprocessor;
mj({math: 'x + y', format: "TeX", mml: true},function(result){
postprocessor({speakText: true}, result, function(output){
console.log(output.speakText) // => x plus y
})
});
mathjax-node-sre provides a preprocessor
which expects mathjax-node input and replaces the input with the result of (if necessary converting to) MathML and enriching the MathML with SRE.
For example:
var preprocessor = require('mathjax-node-sre').preprocessor;
preprocessor({ math: 'x^2', format: "TeX"}, function(output){
console.log(output.math) // => <math xmlns="http://www.w3.org/1998/Math/MathML" display="block" alttext="x^2"><msup data-semantic-type="superscript" data-semantic-role="latinletter" data-semantic-id="2" data-semantic-children="0,1"><mi data-semantic-type="identifier" data-semantic-role="latinletter" data-semantic-font="italic" data-semantic-id="0" data-semantic-parent="2">x</mi><mn data-semantic-type="number" data-semantic-role="integer" data-semantic-font="normal" data-semantic-id="1" data-semantic-parent="2">2</mn></msup></math>
})
FAQs
Extend mathjax-node using speechruleengine
We found that mathjax-node-sre demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.