mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
fix: Simplify regex
This commit is contained in:
@@ -35,11 +35,11 @@ function generateRegexRules(delimiters) {
|
||||
|
||||
if (!display) {
|
||||
inlinePatterns.push(
|
||||
`${escapedLeft}((?:\\\\.|[^\\\\\\n])*?(?:\\\\.|[^\\\\\\n${escapedRight}]))${escapedRight}`
|
||||
`${escapedLeft}((?:\\\\[^]|[^\\\\])+?)${escapedRight}`
|
||||
);
|
||||
} else {
|
||||
blockPatterns.push(
|
||||
`${escapedLeft}((?:\\\\.|[^\\\\\\n])*?(?:\\\\.|[^\\\\\\n${escapedRight}]))${escapedRight}`
|
||||
`${escapedLeft}((?:\\\\[^]|[^\\\\])+?)${escapedRight}`
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -109,6 +109,8 @@ function katexTokenizer(src, tokens, displayMode: boolean) {
|
||||
|
||||
const match = src.match(ruleReg);
|
||||
|
||||
console.log("searching:", src);
|
||||
|
||||
if (match) {
|
||||
const text = match
|
||||
.slice(2)
|
||||
|
||||
Reference in New Issue
Block a user