| … | … | @@ -62,6 +69,15 @@ export function parseInlineMarkdown(text: string): RichTextSpan[] { | |
| 72 | + | if (char === "_") { | |
| 73 | + | let word = literalWords[literalWord]; | |
| 74 | + | while (word && word.index + word[0].length <= index) word = literalWords[++literalWord]; | |
| 75 | + | if (word && word.index <= index) { | |
🟠 High src/composer-rich-text.ts:75
When a path token ends with _ inside an already-open underscore emphasis span, parseInlineMarkdown treats the closing delimiter as literal, so subsequent text is incorrectly styled and the underscore leaks into buildTiptapContent. Only apply the literal-token shortcut when that underscore cannot close the active stack delimiter.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/web/src/composer-rich-text.ts around line 75: |
| 2 | |
| 3 | When a path token ends with `_` inside an already-open underscore emphasis span, `parseInlineMarkdown` treats the closing delimiter as literal, so subsequent text is incorrectly styled and the underscore leaks into `buildTiptapContent`. Only apply the literal-token shortcut when that underscore cannot close the active stack delimiter. |