Replies: 1 comment
-
I just found out an eclectic method to solve this problem: When a "dollar-number" combination prefix appears in a selected math formula, I will distinctively enclose the entire math formula in For example, Therefore, every const sensitive_math = /(\s*)\$(\d[^$]*)\$(\s*)/g;
if (sel.match(sensitive_math))
sel = sel.replaceAll(sensitive_math, "$1\${{$2}}\$$$3"); But the weakness of this method is apparent. Now I have 16 |
Beta Was this translation helpful? Give feedback.
-
I have some practical snippets which will allow me to switch the callout style easily by
important
is linked to1
)note/tip/...
callout style will switch toimportant
style.But when the context contains LaTeX characters which starts with NUMBER these snippets will behave incorrectly.
I find the following part causing the issue:
7
;$2+8$
, it treats$2
as a placeholder instead of normal characters, and the output becomes+8$
.I believe the reason of this bug is that the
replacement => {}
will implicitly perform a regex substitution at the end.So, how can I avoid this incorrect regex interpretation when the callout contents contain LaTeX formulas which starts with a number?
Beta Was this translation helpful? Give feedback.
All reactions