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

fix: improve code fence stripping and JSX normalize for tab-indented content - #158

Merged
jp-knj merged 6 commits into
mainfrom
fix/typecheck-null-registry
Jan 29, 2026
Merged

jp-knj merged 6 commits into
mainfrom
fix/typecheck-null-registry

Conversation

@jp-knj

@jp-knj jp-knj commented Jan 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix stripCodeFences regex to correctly pair fence openers/closers per CommonMark spec, eliminating the last pre-detected fallback file (es/guides/backend/xata.mdx)
  • Add tab-to-space re-indentation for list JSX components (e.g. <FileTree>) and code fence tracking in normalize_list_jsx_components
  • Fix null vs undefined typecheck for registry param in blocks-to-jsx.ts

Test plan

  • pnpm --dir packages/astro-markflow test — 289 tests pass
  • pnpm --dir packages/astro-markflow run build — clean
  • cargo test --workspace — Rust tests including new tab-indent and fence tracking tests
  • withastro-docs build shows 0 pre-detected fallback files

🤖 Generated with Claude Code

jp-knj and others added 3 commits January 29, 2026 21:46
Use `registry ?? undefined` when passing to slotChildrenToHtml() since
the parameter accepts `Registry | undefined` but the local variable is
`Registry | null`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…content

- Fix stripCodeFences regex to use `[ \t]*$` for closers (per CommonMark
  spec) and disallow backticks in info strings, preventing mismatched
  fence pairs with consecutive code blocks
- Add tab-to-space re-indentation for list JSX components (FileTree etc.)
- Add code fence tracking in normalize_list_jsx_components to skip
  fenced content
- Track fence marker length to prevent premature closes with nested fences
- Add FileTree to LIST_JSX_COMPONENTS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude

claude Bot commented Jan 29, 2026

Copy link
Copy Markdown

Code review

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

jp-knj and others added 3 commits January 29, 2026 23:42
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Track fence opener indent and allow closers within opener_indent+3,
matching CommonMark spec while supporting list-item code fences.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jp-knj
jp-knj merged commit d7a5ad7 into main Jan 29, 2026
17 of 18 checks passed
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