mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix codeblock underscores with language
This commit is contained in:
@ -8,7 +8,7 @@ export const markdownUnderscoreExt = () => {
|
|||||||
|
|
||||||
return [{
|
return [{
|
||||||
type: 'output',
|
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) {
|
replace: function(match, codeContent, italicContent) {
|
||||||
if (codeContent) {
|
if (codeContent) {
|
||||||
// If it's inside <code> tags, return unchanged
|
// If it's inside <code> tags, return unchanged
|
||||||
|
Reference in New Issue
Block a user