Repository navigation
Conversation
|
@wkd09 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
Utkarsh-upadhyay9
left a comment
There was a problem hiding this comment.
I ran the test file on this branch (133 passed) and compared a few extra inputs against markdown-it-py in CommonMark mode:
- a real heading right after a closed comment, text after
-->on the closing line, a tab-indented<!--(an indented code block), and<!--opened inside a list item (- <!--followed by an unindented# B) all split the same way CommonMark parses them ✔ para <!--\n# B\n-->still splits at# B. CommonMark agrees, because an ATX heading interrupts the paragraph before the inline comment can span the lines ✔
One related gap, outside the scope of this PR: other HTML blocks hide headings the same way. In CommonMark, # A\n<div>\n# B\n</div> is a single html_block, so # B isn't a heading, but the splitter still starts a new section there. Those block types (6/7) end at a blank line instead of a closer, so they'd need different handling from the comment regex. That's probably better as a separate issue.
The comment handling looks good to me.
Related Issues
Fixes #14051.
Proposed Changes
A commented-out heading in a Markdown help page could give the following paragraph the wrong
headermetadata. In the issue example, filtering by🍕 Pizza deliverymissed the delivery time because it was indexed underOld delivery policy.Skip heading candidates inside line-start HTML comment blocks while preserving the original text. Scan comments and fenced code blocks in source order so a marker inside one cannot open the other.
How did you test it?
keep_headers. After the fix, the delivery time is in the pizza section and filtering for the old policy returns no documents.pytest -q test/components/preprocessors/test_markdown_header_splitter.pylocally. All 133 tests passed, including coverage for unclosed comments, code fences, and secondary split offsets.Notes for the reviewer
The implementation and tests were generated with Codex.
Checklist