mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Markdown fix: Don't eat verticals/newlines
This commit is contained in:
@ -267,7 +267,7 @@ function fixMarkdown(text) {
|
|||||||
let newText = text;
|
let newText = text;
|
||||||
for (let i = matches.length - 1; i >= 0; i--) {
|
for (let i = matches.length - 1; i >= 0; i--) {
|
||||||
let matchText = matches[i][0];
|
let matchText = matches[i][0];
|
||||||
let replacementText = matchText.replace(/(\*|_)(\s+)|(\s+)(\*|_)/g, '$1$4');
|
let replacementText = matchText.replace(/(\*|_)([\t \u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]+)|([\t \u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]+)(\*|_)/g, '$1$4');
|
||||||
newText = newText.slice(0, matches[i].index) + replacementText + newText.slice(matches[i].index + matchText.length);
|
newText = newText.slice(0, matches[i].index) + replacementText + newText.slice(matches[i].index + matchText.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user