Skip to content

Commit 3f58643

Browse files
ofriwclaude
andcommitted
Extract React components as markers in markdown parser
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1ba4643 commit 3f58643

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/lib/markdown-parser.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ export function parseMarkdownContent(filePath) {
128128
// Remove frontmatter
129129
let cleaned = content.replace(/^---[\s\S]*?---\n/, '');
130130

131-
// Remove JSX components
131+
// Extract and preserve React components (capital letter start = React components)
132+
// Replace with clear markers so LLM can detect them
133+
cleaned = cleaned.replace(/<([A-Z][a-zA-Z]*)\s*\/>/g, '[VISUAL_COMPONENT: $1]');
134+
135+
// Remove remaining HTML tags (lowercase = HTML elements)
132136
cleaned = cleaned.replace(/<[^>]+>/g, '');
133137

134138
// First pass: Find all code blocks and their contexts

0 commit comments

Comments
 (0)