Repository navigation
fix(asciidoc): drop the closing marks of symmetric section titles - #4938
Conversation
Signed-off-by: kevin9327 <5299031+kevin9327@users.noreply.github.com>
|
✅ DCO Check Passed Thanks @kevin9327, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The PR changes the AsciiDoc backend. It removes the closing Topic labels added: CI safety: no concern found. A maintainer must still approve CI. 1 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at de02936d89. It read the code and did not run it.
I found no defect. _strip_closing_marker in docling/backend/asciidoc_backend.py:891 removes a trailing run of = only when whitespace precedes it and its length equals the opening marker. === Details == and == Intro === keep their text, as the PR says. The new test covers a matched title, a matched section header, and a mismatched closing run.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
geoHeil
left a comment
There was a problem hiding this comment.
Reviewed de02936d89b2ee9a8b9ee41c4984fd512bb5f6c6. No code blocker found. The base/head case confirms that symmetric closing marks are removed and different-length marks stay in the title. Document ownership and heading order stay correct. All 54 AsciiDoc tests pass locally. Hosted CI, docs, and patch coverage are green.
Local make check stops on file-length violations that already exist on base. The other read-only checks pass. I made no source or reference-data changes.
AsciiDoc lets a document or section title be closed by the same marks that open it, and Asciidoctor leaves those marks out of the title (its
AtxSectionTitleRxis^(=={0,5}|#\#{0,5})[ \t]+(.+?)(?:[ \t]+\1)?$). The AsciiDoc backend kept them in the heading text:The fix strips a trailing run of
=only when it has exactly the length of the opening marker and is preceded by whitespace, as in Asciidoctor. So=== Details ==keeps its textDetails ==. Titles without closing marks parse the same as before.Checklist:
Review evidence:
tests/test_backend_asciidoc.py::test_symmetric_titles_drop_their_closing_marksfails onmainand passes with the fix. It also checks that marks of a different length stay in the title.tests/test_backend_asciidoc.pypass, includingtest_asciidocs_examples, so the reference outputs are unchanged. I did not run the full suite.ruff format --checkandruff checkpass on the changed files.AI assistance: I used an AI coding assistant (Grok Bot) to help find and write this fix. I reviewed the change and ran the tests above myself.