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

Aperta Adatta ai principianti
#5,331 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@sohailshk ci sta già lavorando.

Dal 13/11/2026.

  • #5348 di @sohailshk — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

La gestione delle interruzioni si trova in docling/backend/asciidoc_backend.py, il modulo che il repro importa come AsciiDocBackend. Esegui il ciclo incluso sui marcatori per vedere quali righe diventano paragrafi o elementi di elenco. Il lavoro è completo quando ogni marcatore tra due paragrafi produce solo i testi dei due paragrafi, mentre un'interruzione all'interno di un paragrafo e le righe come -- not a break mantengono il loro testo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
71k
Fork
5.4k
Merge medio
2g 22h
PR unite (30g)
161

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di docling-project/docling

Tutte le issue di docling-project/docling

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.