Closed Wenangsani closed 3 years ago
Looks like it's checking for sin before sinh. Swapping the order so sinh is before sin doesn't seem to work though...
parseMathFunction: function (it) {
this.mathFunction.names.forEach((name, index) => {
const regExp = new RegExp(name, 'g');
if(it.match(regExp)){
it = it.replace(regExp, this.mathFunction.scripts[index] + ' ');
}
});
return it;
},
names: [
"sin", "arcsin", "sinh", "sec",
scripts: [
"\\sin", "\\arcsin", "\\sinh", "\\sec",
Oh, changing the order does this
sinh
-> \\sinh
but then sin is also replaced so it becomes \\\\sin h
@Wenangsani
Thanks for the feedback.
@murkle
Thanks for the really useful analysis. These overlap function names should be reordered and we need to avoid the \\\\sin h
situation.
I'll fix it.
I've published version 1.1.2 to npm, it should work now.
why
<mo>sinh</mo><mn>45</mn>
become\sin h45
?