Skip to content

fix: recognize indented Markdown headers - #13352

Merged
davidsbatista merged 3 commits into
deepset-ai:mainfrom
JackyHsu-X:fix/indented-markdown-headings
Oct 27, 2026
Merged

davidsbatista merged 3 commits into
deepset-ai:mainfrom
JackyHsu-X:fix/indented-markdown-headings

Conversation

@JackyHsu-X

Copy link
Copy Markdown
Contributor

Related Issues

No existing issue. This is separate from #13104 (tabs after the header prefix) and #13344 (code fences).

Proposed Changes:

MarkdownHeaderSplitter ignores valid ATX headings such as ## Install, merging their sections and losing header metadata used for retrieval. Accept up to three leading spaces, as specified by CommonMark, while preserving the original content. Four-space and tab-indented lines remain content.

Add regression coverage for header hierarchy, page numbers, both keep_headers modes, secondary splitting, selected levels, and code-block exclusion. Update the docstring, docs, and release note.

How did you test it?

On Windows / Python 3.12, using the project's Hatch environments:

  • Original source with the new tests: 13 failed, 79 passed. Fixed splitter suite: 92 passed.
  • Splitter, DocumentWriter, and sync/async FilterRetriever suites: 121 passed, 2 integration tests deselected.
  • Real sync/async indexing and section-filtering smoke checks passed.
  • Full hatch run fmt-check, scoped mypy on both changed Python files, and all applicable pre-commit hooks passed.

The full repository test suite, live integrations, and documentation build were not run.

Notes for the reviewer

Fully generated with Codex at the author's request. Codex ran the local checks reported above.

Checklist

  • Read the contributing guidelines and code of conduct.
  • Added regression tests, updated the docstring and documentation.
  • Used a conventional PR title and added a release note.
  • Ran pre-commit hooks and fixed the reported issues.
  • Related issue update: N/A (no existing issue).

@JackyHsu-X
JackyHsu-X requested a review from a team as a code owner October 20, 2026 20:29
@JackyHsu-X
JackyHsu-X requested review from davidsbatista and removed request for a team October 20, 2026 20:29
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@JackyHsu-X is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@HaystackBot

Copy link
Copy Markdown
Contributor

Hi @JackyHsu-X, thanks a lot for your contribution! 🙏

We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.

To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.

@HaystackBot
HaystackBot removed the request for review from davidsbatista October 20, 2026 21:51
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Oct 20, 2026
@HaystackBot
HaystackBot marked this pull request as draft October 20, 2026 21:51
@CLAassistant

CLAassistant commented Oct 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@HaystackBot
HaystackBot marked this pull request as ready for review October 21, 2026 13:27
@HaystackBot HaystackBot removed the cla-pending PR is in draft until the contributor signs the CLA label Oct 21, 2026
@HaystackBot

Copy link
Copy Markdown
Contributor

Thanks for signing the CLA, @JackyHsu-X! 🎉 This PR is now ready for review again and the reviewer has been re-assigned.

@github-actions github-actions Bot added the type:documentation Improvements on the docs label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/components/preprocessors
  markdown_header_splitter.py
Project Total  

This report was generated by python-coverage-comment-action

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
haystack-docs Ready Ready Preview Oct 27, 2026 10:47am UTC

Request Review

@davidsbatista davidsbatista left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the contribution

@davidsbatista
davidsbatista enabled auto-merge (squash) October 27, 2026 10:50
@davidsbatista
davidsbatista merged commit 5bd58d6 into deepset-ai:main Oct 27, 2026
25 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8dc7cd9b Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants