AsciiDoc: thematic breaks and page breaks are kept as text or turned into list items

Open Beginner friendly
#5,331 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@sohailshk is already working on this.

Since Nov 13, 2026.

  • #5348 by @sohailshk — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

The break handling lives in docling/backend/asciidoc_backend.py, the module the repro imports as AsciiDocBackend. Run the included loop over the markers to see which lines become paragraphs or list items. Done means each marker between two paragraphs yields only the two paragraph texts, while a break inside a paragraph and lines like -- not a break keep their text.

Written by the indexing model from the issue text.

Description

asciidoc bug priority:low
Bug

The AsciiDoc backend does not know thematic breaks and page breaks. A line that starts a block and holds ''', ---, *** or <<< comes out as paragraph text. A line with * * * or - - - is read as a list item whose text is * * or - -. These lines separate blocks, so they must not add content to the document.

AsciiDoc has these breaks: ''' (three or more single quotes), ---, - - -, ***, * * *, ___ and _ _ _ for a thematic break, and <<< for a page break.

Steps to reproduce
from io import BytesIO

from docling.backend.asciidoc_backend import AsciiDocBackend
from docling.datamodel.base_models import InputFormat
from docling.datamodel.document import InputDocument

for marker in ["'''", "---", "***", "<<<", "* * *", "- - -"]:
    source = f"First paragraph.\n\n{marker}\n\nSecond paragraph.\n"
    in_doc = InputDocument(
        path_or_stream=BytesIO(source.encode("utf-8")),
        format=InputFormat.ASCIIDOC,
        backend=AsciiDocBackend,
        filename="test.adoc",
    )
    doc = in_doc._backend.convert()
    print(repr(marker), [item.text for item, _ in doc.iterate_items() if hasattr(item, "text")])

Result on main at 1ae470a1 (the break handling is unchanged on main at b9bf356f): the marker appears between the two paragraphs, as text for ''', ---, *** and <<<, and as a list item for * * * and - - -.

Expected: ['First paragraph.', 'Second paragraph.'] for every marker.

A break inside a paragraph (First line. / ''' / Second line. on consecutive lines) is text in AsciiDoc, and a line such as -- not a break or <<anchor>> is not a break. These keep their text.

I have a fix with a test and can open a PR.

Docling version

Docling version: main @ 1ae470a1 (code unchanged at b9bf356f, 2.150.0)

Python version

Python 3.13.3

Dominant language
Python
Stars
71k
Forks
5.4k
Avg merge
2d 22h
Merged PRs (30d)
161

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docling-project/docling

All issues in docling-project/docling

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.