Skip to content

feat: parse MDX syntax as distinct nodes - #145

Merged
luojiyin1987 merged 2 commits into
masterfrom
feat/mdx-syntax-nodes
Oct 25, 2026
Merged

luojiyin1987 merged 2 commits into
masterfrom
feat/mdx-syntax-nodes

Conversation

@luojiyin1987

@luojiyin1987 luojiyin1987 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Add parseMdx and parseMdxWithSourceMap.
  • Keep ESM, JSX, and expressions in distinct AST nodes.
  • Map Markdown text inside MDX without mapping JSX attributes or JavaScript values.
  • Export MDX node types and document the source map limits.

Verification

  • pnpm run build
  • pnpm run lint
  • pnpm run test (2021 tests pass)
  • Package tests cover CommonJS, ESM, and TypeScript consumers.
  • MDX 3.1.1 compiles the repaired Chinese sample with GFM and math plugins.
  • Byte checks confirm ESM, JSX attributes, and expressions stay unchanged.

The parser repository has no CLI --fix entry point.
The CLI rejection tests belong in the CLI repository.

No sensitive data was changed or shared.

Closes #144

Add MDX parsing and source map entry points.

Keep ESM, JSX attributes, and expressions separate from Markdown text.

Add MDX node, source map, package, and type tests.

No sensitive data was changed.

Refs #144
Test the Chinese MDX sample with MDX 3.1.1.

Check AST parity, source ranges, and unchanged ESM, JSX attributes, and expressions.

Compile the repaired source with GFM and math plugins.

Refs #144
@luojiyin1987
luojiyin1987 merged commit 5feb010 into master Oct 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse MDX syntax as distinct nodes

1 participant