Frontmatter
| id | 9265 |
| title | Fix markdown escaping for nested special code blocks |
| state | Closed |
| labels | bugdocumentationai |
| assignees | tobiu |
| createdAt | Feb 23, 2026, 11:34 AM |
| updatedAt | Feb 23, 2026, 11:36 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9265 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 23, 2026, 11:36 AM |
Fix markdown escaping for nested special code blocks
tobiu assigned to @tobiu on Feb 23, 2026, 11:35 AM

tobiu
Feb 23, 2026, 11:35 AM
Input from Gemini 3.1 Pro:
✦ I've implemented the unescaping step (
\```to`) right before `HighlightJs` runs inside `processReadonlyCodeBlocks`. I have also modified the custom regex blocks (`regexLivePreview`, `regexMermaid`, `regexNeoComponent`) to ignore blocks preceded by a backslash using negative lookbehinds. Furthermore, `regexCodeBlock` has been updated to properly handle` with 3 or more backticks so it properly pairs opening and closing sets.The guide
ContentEngine.mdwas also updated to use the formal escaping syntax instead of the visual workaround.The changes have been committed and pushed to
dev. Closing this issue.
tobiu closed this issue on Feb 23, 2026, 11:36 AM
Problem When a guide author wants to display a special markdown block (like
neo-component,live-preview, ormermaid) inside areadonlycode block without executing it, they currently have to use workarounds likebecause our block extractors ignore standard markdown nesting. If they escape it using ````, the Highlight.js output causes the backslash to become separated from the backticks by HTML tags, preventingmarked.js` from correctly unescaping them. This results in the leading backslash being visible to the user.Solution
escaping by checking for a preceding backslash via negative lookbehind(?<!\)`.regexCodeBlockto correctly match blocks with 3 or more backticks so that the closing backticks match the opening ones.codetoHighlightJsinsideprocessReadonlyCodeBlocksto remove the backslash escaping.ContentEngine.mdguide to use the proper ```` ` escape sequence instead of the workaround.