You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Making a fraction with auto-fraction and a parenthesized product like (a)(b) in the numerator removes the ( ) on the outside.
To Reproduce
In a math environment, type (n+1)(n+2)/. The auto-fraction produces \frac{n+1)(n+2}{}.
Expected Behavior
It should not remove the parentheses from the outside, leaving \frac{(n+1)(n+2)}{}.
One possible solution would be to check if the regex described here https://stackoverflow.com/questions/546433/regular-expression-to-match-balanced-parentheses has more than one match (indicating that the numerator is a product and not just one term in parentheses). It seems that Obsidian regexes use the JS implementation though, so it might not be possible without scanning the entire string to count ( and ).
The text was updated successfully, but these errors were encountered:
previously, `(a)(b)/` would be erroneously transformed into `\frac{a)(b}{}`,
as algorithm would just check if first and last were open and closed parens.
now, only removes outer parentheses if they are matched.
fixesartisticat1#206
duanwilliam
added a commit
to duanwilliam/obsidian-latex-suite
that referenced
this issue
Oct 25, 2023
previously, `(a)(b)/` would be erroneously transformed into `\frac{a)(b}{}`,
as algorithm would just check if first and last were open and closed parens.
now, only removes outer parentheses if they are matched.
fixesartisticat1#206
previously, `(a)(b)/` would be erroneously transformed into `\frac{a)(b}{}`,
as algorithm would just check if first and last were open and closed parens.
now, only removes outer parentheses if they are matched.
fixesartisticat1#206
Description
Making a fraction with auto-fraction and a parenthesized product like
(a)(b)
in the numerator removes the( )
on the outside.To Reproduce
In a math environment, type
(n+1)(n+2)/
. The auto-fraction produces\frac{n+1)(n+2}{}
.Expected Behavior
It should not remove the parentheses from the outside, leaving
\frac{(n+1)(n+2)}{}
.One possible solution would be to check if the regex described here https://stackoverflow.com/questions/546433/regular-expression-to-match-balanced-parentheses has more than one match (indicating that the numerator is a product and not just one term in parentheses). It seems that Obsidian regexes use the JS implementation though, so it might not be possible without scanning the entire string to count
(
and)
.The text was updated successfully, but these errors were encountered: