AsciiDoc: thematic breaks and page breaks are kept as text or turned into list items
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
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
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
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di docling-project/docling
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
docling-project/docling#5592 ·
I maintainer di solito rispondono entro 2 giorni
-
`api_image_request` logs and propagates the raw error response body, leaking the request's API key on 401Forse già presa @prassu017 l’ha presa 7 giorni fa. Apertabug priority:critical
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
docling-project/docling#5486 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
AFP: export_to_doctags() raises ZeroDivisionError because every page has size 0x0Forse già presa @Krushil-Dhankecha l’ha presa 12 giorni fa. Apertabug priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
docling-project/docling#5355 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Merged paragraph across pages of different heights: continuation bbox uses the first page's heightForse già presa @galer1us l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
docling-project/docling#5286 ·
I maintainer di solito rispondono entro 2 giorni
-
CSV: a custom delimiter in the sep= hint is rejectedForse già presa @saiteja-018 l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
docling-project/docling#5284 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di docling-project/docling
Issue simili
-
Task select patterns with uppercase letters never matchForse già presa @manobhisriram l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
app: scripts status: backlog type: housekeeping
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
netbox-community/netbox-scripts#239 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
developmentseed/titiler-cmr#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 charactersForse già presa @omkarbandikatte l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno