[Bug]: Markdown splitting skips valid ATX headings with indentation

Open
#7,494 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@123XieC is already working on this.

Since Nov 12, 2026.

  • #7495 by @123XieC — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
markdown, python
Domain
data

Research direction

Start by locating the production Markdown layout planner and the parser layout path described in the issue. Reproduce with the three-space ## Install heading between # Guide and ## Run, then check the same case with one, two, and four leading spaces. Done when headings with up to three spaces form sections and a four-space code line is excluded; linked pull request #7495 is already open.

Written by the indexing model from the issue text.

Description

Issue Origin

Reproduced in the production Markdown layout planner on current main.

Bug Description

The layout planner skips ATX headings preceded by one to three spaces. It then divides the text by size or by the next unindented heading, so the imported layout has no section for the indented heading. CommonMark permits up to three spaces before an ATX heading.

Steps to Reproduce

Plan a large Markdown document with # Guide, a line containing three spaces followed by ## Install, and an unindented ## Run. Give the two sections about 1,200 characters each so they are large enough to be emitted as separate sections.

The Install section is emitted only when the heading has zero leading spaces. The same test fails for one, two, and three leading spaces. A four-space line is correctly excluded as code.

Expected Behavior

Headings with up to three leading spaces participate in the normal section layout. A four-space code line remains outside heading detection.

Environment

main at 5043e1f, Python 3.12.16, macOS arm64. The fixture exercises the real parser layout path without a model or storage server. AI investigation without human review.

Dominant language
Python
Stars
41.8k
Forks
3.4k
Avg merge
19h 29m
Merged PRs (30d)
500

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from volcengine/OpenViking

All issues in volcengine/OpenViking

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.