diff --git a/public/scripts/showdown-underscore.js b/public/scripts/showdown-underscore.js index 78a1adef7..bc7743d7b 100644 --- a/public/scripts/showdown-underscore.js +++ b/public/scripts/showdown-underscore.js @@ -7,9 +7,19 @@ export const markdownUnderscoreExt = () => { } return [{ - type: 'lang', - regex: new RegExp('\\b(?$1', + type: 'output', + regex: new RegExp('([\\s\\S]*?<\\/code>)|(? tags, return unchanged + return match; + } else if (italicContent) { + // If it's an italic group, apply the replacement + return '' + italicContent + ''; + } + // If none of the conditions are met, return the original match + return match; + }, }]; } catch (e) { console.error('Error in Showdown-underscore extension:', e);