InlineMathSyntax constructor
InlineMathSyntax({
- bool dollar = true,
Implementation
InlineMathSyntax({bool dollar = true})
: super(
dollar
? r'\\\((.+?)\\\)'
r'|\$\$(.+?)\$\$'
r'|\\\[(.+?)\\\]'
// not right after a letter or digit: US$5 is a price
r'|(?<![\w$])\$(?=[^\s$])((?:\\.|[^$\\\n])+?)(?<=[^\s\\])\$(?!\d)'
// (?!)() never matches; it keeps the group numbers the same
: r'\\\((.+?)\\\)|(?!)()|\\\[(.+?)\\\]',
);