Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions remote-content/remote-sources/repo-transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ function applyBasicMdxFixes(content) {

return `:::${docusaurusType}\n${cleanContent}\n:::\n`;
})
// Fix HTML comments for MDX compatibility
.replace(/<!--\s*/g, '{/* ')
.replace(/\s*-->/g, ' */}')
// Fix HTML comments for MDX compatibility (without breaking Mermaid arrows)
.replace(/<!--([\s\S]*?)-->/g, (_match, comment) => {
const normalized = comment
.replace(/^\s*/, ' ')
.replace(/\s*$/, ' ');
return `{/*${normalized}*/}`;
})
// Fix HTML tags for MDX compatibility
.replace(/<br>/g, '<br />')
.replace(/<br([^/>]*?)>/g, '<br$1 />')
Expand Down