Skip to content

Commit

Permalink
use let and const, not var
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan committed Jan 25, 2024
1 parent 4389331 commit 02b942f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdocs/js/MathJaxConfig/mathjax-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ if (!window.MathJax) {
loader: { load: ['input/asciimath', '[tex]/noerrors'] },
startup: {
ready: function() {
var AM = MathJax.InputJax.AsciiMath.AM;
const AM = MathJax.InputJax.AsciiMath.AM;
// modify existing AsciiMath triggers
var i = AM.names.indexOf('**');
let i = AM.names.indexOf('**');
AM.symbols[i] = { input: "**", tag: "msup", output: "^", tex: null, ttype: AM.TOKEN.INFIX };

i = AM.names.indexOf('infty');
AM.names[i] = 'infinity';
AM.symbols[i] = { input:"infinity", tag:"mo", output:"\u221E", tex:"infty", ttype:AM.TOKEN.CONST };

// add AsciiMath triggers for consistency with MathObjects
var newTriggers = {
const newTriggers = {
inf: {precedes:'infinity', symbols:{tag:"mo", output:"\u221E", tex:"infty", ttype:AM.TOKEN.CONST}},
Infinity:{precedes:'Lambda', symbols:{tag:"mo", output:"\u221E", tex:"infty", ttype:AM.TOKEN.CONST}},
Inf: {precedes:'Infinity', symbols:{tag:"mo", output:"\u221E", tex:"infty", ttype:AM.TOKEN.CONST}},
Expand All @@ -35,7 +35,7 @@ if (!window.MathJax) {
'><': {precedes:'><|', symbols:{tag:"mo", output:"\u00D7", tex:"times", ttype:AM.TOKEN.CONST}},
};
for (const trigger in newTriggers) {
var i = AM.names.indexOf(newTriggers[trigger].precedes);
const i = AM.names.indexOf(newTriggers[trigger].precedes);
AM.names.splice(i, 0, trigger);
AM.symbols.splice(i, 0, {input:trigger, ...newTriggers[trigger].symbols});
}
Expand Down

0 comments on commit 02b942f

Please sign in to comment.