Repository navigation
Conversation
|
✅ DCO Check Passed Thanks @Eapp1e, 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 AsciiDoc backend now opens a listing block on four or more hyphens and a literal block on four or more dots. A new test covers both cases. CI safety: no concern found. A maintainer must still approve CI. 1 related pull request(s) in the same code
The |
3395211 to
5948305
Compare
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 5948305ce1. It read the code and did not run it.
The fix correctly generalises listing and literal block delimiters from exact-string matches to 4-or-more-character regex matches. The test directly reproduces the reported defect. No regressions found in the closing logic (exact equality against the recorded opener is preserved) or in the ordering of delimiter checks.
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! |
|
Friendly follow-up after a week: this one is a two-line widening of the listing/literal block delimiter check (four or more uniform delimiters), with a regression test for |
AsciiDoc treats the delimiter length as a minimum: listing blocks open with four or more hyphens and literal blocks with four or more dots. The backend only accepted exactly four, so a block opened with five or more delimiters was parsed as a paragraph and its content leaked into running text. Match four or more and keep the real delimiter line so the closing delimiter is still found. Signed-off-by: Eapp1e <[email protected]>
5948305 to
19cb7a0
Compare
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 19cb7a09f0. It read the code and did not run it.
I checked that regular expressions correctly recognize AsciiDoc listing and literal blocks with four or more delimiter characters without regressions in block closing or content leakage.
A maintainer makes the merge decision. This review never approves the pull request.
Summary
An AsciiDoc listing or literal block opens on four or more delimiter characters — the Asciidoctor documentation names the length "minimum delimiter" and its
is_delimited_block?accepts any uniform run. The backend tested only the exact strings----and...., so a block with a longer marker was not opened: the markers stayed in the document as paragraphs and the code between them became prose.Fix
Two regexes replace the exact-string tests:
_VERBATIM_DELIMITER_REis-{4,}|\.{4,}, and_LISTING_DELIMITER_REis-{4,}because only a listing block takes a[source,lang]attribute. The closing check keeps comparing against the recorded opener, which matches Asciidoctor's behaviour of closing on an identical line. This mirrors the rule the same file already applies to comment blocks (_COMMENT_BLOCK_DELIMITER_RE = re.compile(r"/{4,}")).Tests
tests/test_backend_asciidoc.py::test_delimiter_longer_than_four_characters_opens_the_blockconverts[source,python]+-----+x = 1+-----and a.....literal block, then asserts both become code items, that the language is Python, and that no marker text leaks into the body.On the tree without the fix:
1 failed, 79 passed; with the fix:80 passed.tests/test_backend_text_encoding.py(55 passed) andtests/test_input_doc.py(43 passed) are unchanged. No file undertests/datauses a delimiter longer than four characters, so no reference data changes.The branch is now based on
mainat 9b25840, so the pull request no longer conflicts with the table-row change that landed in the same file.Fixes #5044