// Showdown extension that replaces words surrounded by singular underscores with tags export const markdownUnderscoreExt = () => { try { if (!canUseNegativeLookbehind()) { console.log('Showdown-underscore extension: Negative lookbehind not supported. Skipping.'); return []; } return [{ type: 'output', regex: new RegExp('(]*)?>[\\s\\S]*?<\\/code>)|\\b(? 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); return []; } }; function canUseNegativeLookbehind() { try { new RegExp('(?