Replace underscores in HTML output

138d6877f79cd074539d0108b25ef627fcf50d86

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +5 -5Ignore whitespace
public/scripts/showdown-underscore.js+5 -5
@@ -7,11 +7,11 @@ export const markdownUnderscoreExt = () => {
7 }7 }
88
9 return [{9 return [{
10 type: 'lang',10 type: 'output',
11 regex: /(`{3,})\s*\n[\s\S]*?\n\1(?:\n|$)|(`{1,2}).*?\2|(\n`\n[\s\S]*?\n`\n)|(?<!\S)_(?!_)([^_\n]+?)(?<!_)_(?!\w)/g,11 regex: new RegExp('(<code>[\\s\\S]*?<\\/code>)|(?<!\\S)_(?!_)([^_\\n]+?)(?<!_)_(?!\\w)', 'g'),
12 replace: function(match, tripleBackticks, singleOrDoubleBackticks, singleBackticksWithLineBreaks, italicContent) {12 replace: function(match, codeContent, italicContent) {
13 if (singleOrDoubleBackticks || tripleBackticks || singleBackticksWithLineBreaks) {13 if (codeContent) {
14 // If it's any type of backticks, return unchanged14 // If it's inside <code> tags, return unchanged
15 return match;15 return match;
16 } else if (italicContent) {16 } else if (italicContent) {
17 // If it's an italic group, apply the replacement17 // If it's an italic group, apply the replacement