fix(outboundtext): keep resource handles intact when normalizing formulas
This commit is contained in:
@@ -11,19 +11,19 @@ import (
|
||||
// well-known math commands, so ordinary prose is left byte-identical.
|
||||
|
||||
var (
|
||||
mathBlockDelimRE = regexp.MustCompile(`\$\$([\s\S]+?)\$\$`)
|
||||
mathInlineDelimRE = regexp.MustCompile(`\$([^$\n]{1,400})\$`)
|
||||
parenDelimRE = regexp.MustCompile(`\\\(([\s\S]+?)\\\)`)
|
||||
bracketDelimRE = regexp.MustCompile(`\\\[([\s\S]+?)\\\]`)
|
||||
sqrtRE = regexp.MustCompile(`\\sqrt\s*(?:\[([^\]]{1,20})\])?\s*\{([^{}]{1,200})\}`)
|
||||
fracRE = regexp.MustCompile(`\\frac\s*\{([^{}]{1,200})\}\s*\{([^{}]{1,200})\}`)
|
||||
supBracedRE = regexp.MustCompile(`\^\s*\{([^{}]{1,40})\}`)
|
||||
subBracedRE = regexp.MustCompile(`_\s*\{([^{}]{1,40})\}`)
|
||||
supCharRE = regexp.MustCompile(`\^([0-9A-Za-z+\-=()])`)
|
||||
subCharRE = regexp.MustCompile(`_([0-9A-Za-z+\-=()])`)
|
||||
commandRE = regexp.MustCompile(`\\([A-Za-z]+)`)
|
||||
braceDelimRE = regexp.MustCompile(`\{([^{}]{0,200})\}`)
|
||||
blankRunRE = regexp.MustCompile(`[ \t]{2,}`)
|
||||
mathBlockDelimRE = regexp.MustCompile(`\$\$([\s\S]+?)\$\$`)
|
||||
mathSpanRE = regexp.MustCompile(`(?s)\$\$.+?\$\$|\\\[.+?\\\]|\\\(.+?\\\)|\$[^$\n]{1,400}\$`)
|
||||
parenDelimRE = regexp.MustCompile(`\\\(([\s\S]+?)\\\)`)
|
||||
bracketDelimRE = regexp.MustCompile(`\\\[([\s\S]+?)\\\]`)
|
||||
sqrtRE = regexp.MustCompile(`\\sqrt\s*(?:\[([^\]]{1,20})\])?\s*\{([^{}]{1,200})\}`)
|
||||
fracRE = regexp.MustCompile(`\\frac\s*\{([^{}]{1,200})\}\s*\{([^{}]{1,200})\}`)
|
||||
supBracedRE = regexp.MustCompile(`\^\s*\{([^{}]{1,40})\}`)
|
||||
subBracedRE = regexp.MustCompile(`_\s*\{([^{}]{1,40})\}`)
|
||||
supCharRE = regexp.MustCompile(`\^([0-9A-Za-z+\-=()])`)
|
||||
subCharRE = regexp.MustCompile(`_([0-9A-Za-z+\-=()])`)
|
||||
commandRE = regexp.MustCompile(`\\([A-Za-z]+)`)
|
||||
braceDelimRE = regexp.MustCompile(`\{([^{}]{0,200})\}`)
|
||||
blankRunRE = regexp.MustCompile(`[ \t]{2,}`)
|
||||
)
|
||||
|
||||
var mathCommands = map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user