Skip to content

fix: Support two-space list indentation tolerance - #7

Merged
Fuyeors merged 1 commit into
mainfrom
fix/list-indent-tolerance
Aug 24, 2026
Merged

fix: Support two-space list indentation tolerance#7
Fuyeors merged 1 commit into
mainfrom
fix/list-indent-tolerance

Conversation

@Fuyeors

@Fuyeors Fuyeors commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

This change supports two-space-step list nesting while retaining legacy odd-space indentation compatibility. Nested list markers are normalized before recursive block parsing, and regression coverage now includes 2-space, 3-space, and 4-space nesting.

Validation

The following local checks pass:

Check Result
pnpm --filter @fuyeor/markdown-parser typecheck Pass
pnpm --filter @fuyeor/markdown-parser test:unit 11/11 pass
pnpm --filter @fuyeor/markdown-parser test:ffm 10 pass, 458 skipped by existing compatibility filters
Prettier and git diff --check Pass

Performance and package size

The benchmark used identical Node/Vitest settings and compared against origin/main. Five runs were used for the flat and new nested scenarios; three runs were used for the legacy nested scenario.

Scenario Median parse time Median sampled peak heap
Flat lists 4.0065 ms → 3.9783 ms (-0.7%) 10.88 MiB → 6.24 MiB (-42.6%)
Legacy 3/5-space nested lists 10.7208 ms → 10.8198 ms (+0.9%) 10.07 MiB → 5.75 MiB (-42.9%)
New 2/4-space nested lists 7.2906 ms → 10.7815 ms (+47.9%) 12.98 MiB → 9.72 MiB (-25.1%)

The new 2/4-space nested input now produces the requested nested AST, so its additional work reflects the newly enabled structure rather than a regression in the legacy-compatible path.

The npm package tarball increased from 43,063 to 43,647 bytes (+584 bytes, +1.36%); unpacked size increased by 2,214 bytes (+0.76%).

CI note

The first GitHub Actions check currently fails during pnpm setup because the existing workflow requests pnpm 11.20.0 while the repository packageManager field requests pnpm 11.22.0. The failure occurs before dependency installation and before any project test runs; it is unrelated to this change.

@Fuyeors
Fuyeors merged commit 527519d into main Aug 24, 2026
1 of 2 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.

1 participant