Fixing issue with Replace All when replacement string includes source string.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
52f859349a
commit
54363b25bc
2 changed files with 2 additions and 5 deletions
|
@ -64,10 +64,7 @@ function arrayFlatMap(callbackFn, thisArg) {
|
|||
* @return {String}
|
||||
*/
|
||||
function stringReplaceAll(from, to) {
|
||||
let str = this
|
||||
while(str.includes(from))
|
||||
str = str.replace(from, to)
|
||||
return str
|
||||
return this.split(from).join(to)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ class LatexAPI extends Module {
|
|||
throw new EvalError("Unknown operator " + item.value + ".")
|
||||
}
|
||||
break
|
||||
case Instruction.IOP3: // Thirdiary operator
|
||||
case Instruction.IOP3: // Ternary operator
|
||||
n3 = nstack.pop()
|
||||
n2 = nstack.pop()
|
||||
n1 = nstack.pop()
|
||||
|
|
Loading…
Reference in a new issue