Closed amilich closed 3 years ago
There's actually a simpler regex commented out in the code that avoids using lookbehinds, but you will lose the ability to escape $
symbols with \$
.
/(?<!\\)\$(.+)(?<!\\)\$/
/\$(.+)\$/
In the future, I'll probably look for a more cross-browser-friendly way to escape.
Thank you! I've actually been testing with /[^\\]?\$([^$\n\\]+)[^\\][\$]/
, which seems to work okay, and then adding 1 to start
inside replaceRangeWith
if the match starts with a space. Probably could be cleaner.
Looks like safari doesn't support lookbehind yet - any alternate regex for the
math_inline
input rule?