Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

fix(astro-markflow): handle single-line getHeadings in RE_SCAN_NOISE regex - #174

Closed
jp-knj wants to merge 1 commit into
mainfrom
fix/scan-noise-single-line-getheadings
Closed

fix(astro-markflow): handle single-line getHeadings in RE_SCAN_NOISE regex#174
jp-knj wants to merge 1 commit into
mainfrom
fix/scan-noise-single-line-getheadings

Conversation

@jp-knj

@jp-knj jp-knj commented Feb 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix RE_SCAN_NOISE regex that over-matched single-line getHeadings() output, stripping the entire JSX body and silently dropping component imports
  • The getHeadings branch now uses an alternation to handle both single-line ({ return [...]; }\n) and multi-line ({\n return [...];\n}\n) formats
  • Add test case for single-line getHeadings scanning

Test plan

  • All 298 existing tests pass (pnpm --dir packages/astro-markflow test)
  • New test verifies single-line getHeadings is stripped without affecting component detection

🤖 Generated with Claude Code

…regex

The getHeadings branch in RE_SCAN_NOISE expected multi-line format with
`\n}` on its own line. For single-line output from blocksToJsx/wrapHtmlInJsxModule,
`[\s\S]*?\n}` would scan past the closing `}` and match the next `\n}` in the file,
stripping the entire JSX body and silently dropping component imports.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jp-knj
jp-knj force-pushed the fix/scan-noise-single-line-getheadings branch from c8d9dfd to 689779b Compare February 1, 2026 16:35
@claude

claude Bot commented Feb 1, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jp-knj

jp-knj commented Feb 1, 2026

Copy link
Copy Markdown
Member Author

Merged into #173 (perf/vite-plugin-reduce-redundant-work).

@jp-knj jp-knj closed this Feb 1, 2026
@jp-knj
jp-knj deleted the fix/scan-noise-single-line-getheadings branch February 3, 2026 11:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant