mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-10 09:00:14 +01:00
Fix codeblock underscores with language
This commit is contained in:
parent
60c22bf803
commit
398b64d720
@ -8,7 +8,7 @@ export const markdownUnderscoreExt = () => {
|
||||
|
||||
return [{
|
||||
type: 'output',
|
||||
regex: new RegExp('(<code>[\\s\\S]*?<\\/code>)|\\b(?<!_)_(?!_)(.*?)(?<!_)_(?!_)\\b', 'g'),
|
||||
regex: new RegExp('(<code(?:\\s+[^>]*)?>[\\s\\S]*?<\\/code>)|\\b(?<!_)_(?!_)(.*?)(?<!_)_(?!_)\\b', 'g'),
|
||||
replace: function(match, codeContent, italicContent) {
|
||||
if (codeContent) {
|
||||
// If it's inside <code> tags, return unchanged
|
||||
|
Loading…
x
Reference in New Issue
Block a user