Fix for unmatched single backticks

e137c5d1543a3238683630098504de8515aa75e2

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

1 files changed, +8 -6Ignore whitespace
public/scripts/showdown-underscore.js+8 -6
@@ -8,15 +8,17 @@ export const markdownUnderscoreExt = () => {
88
99 return [{
1010 type: 'lang',
1111 regex: new RegExp('(`{3})[\\s\\S]*?\\1|(`{1,32}).*?\\12|\\b(?<!_)_(?!_)(.*?)(?<!_)_(?!_)\\b', 'gsg'),
1212 replace: function(match, codeBlocktripleBackticks, singleOrDoubleBackticks, italicContent) {
1313 if (codeBlocktripleBackticks || singleOrDoubleBackticks) {
1414 // If it's aany kind of code block, return it unchanged
1515 return match;
1616 } else if (italicContent) {
1717 // If it's an italic group, apply the replacement
1818 return `'<em>${' + italicContent} + '</em>`';
1919 }
20+ // If neither condition is met, return the original match
21+ return match;
2022 },
2123 }];
2224 } catch (e) {