Repository navigation
Conversation
An AsciiDoc listing block opens on four or more hyphens and a literal block on four or more dots; the Asciidoctor documentation calls the length a minimum delimiter. The backend compared against 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. The same file already applies the four-or-more rule to comment blocks. Signed-off-by: Eapp1e <163811520+Eapp1e@users.noreply.github.com>
|
✅ 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 PR fixes the AsciiDoc backend so that listing and literal block delimiters of five or more characters (e.g. Topic labels added: CI safety: no concern found. A maintainer must still approve CI. 4 related pull request(s) in the same code
The |
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, 62 passed; with the fix:63 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.Fixes #5044