mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 12:48:28 +00:00
fix(markdown): fix parsing if doc ending with table (#873)
Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>
This commit is contained in:
@@ -368,6 +368,7 @@ class MarkdownDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
# Start iterating from the root of the AST
|
# Start iterating from the root of the AST
|
||||||
self.iterate_elements(parsed_ast, 0, doc, None)
|
self.iterate_elements(parsed_ast, 0, doc, None)
|
||||||
self.process_inline_text(None, doc) # handle last hanging inline text
|
self.process_inline_text(None, doc) # handle last hanging inline text
|
||||||
|
self.close_table(doc=doc) # handle any last hanging table
|
||||||
|
|
||||||
# if HTML blocks were detected, export to HTML and delegate to HTML backend
|
# if HTML blocks were detected, export to HTML and delegate to HTML backend
|
||||||
if self._html_blocks > 0:
|
if self._html_blocks > 0:
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
| Character | Name in German | Name in French | Name in Italian |
|
||||||
|
|----------------|------------------|------------------|-------------------|
|
||||||
|
| Scrooge McDuck | Dagobert Duck | Balthazar Picsou | Paperone |
|
||||||
|
| Huey | Tick | Riri | Qui |
|
||||||
|
| Dewey | Trick | Fifi | Quo |
|
||||||
|
| Louie | Track | Loulou | Qua |
|
||||||
6
tests/data/md/ending_with_table.md
Normal file
6
tests/data/md/ending_with_table.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
| Character | Name in German | Name in French | Name in Italian |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Scrooge McDuck | Dagobert Duck | Balthazar Picsou | Paperone |
|
||||||
|
| Huey | Tick | Riri | Qui |
|
||||||
|
| Dewey | Trick | Fifi | Quo |
|
||||||
|
| Louie | Track | Loulou | Qua |
|
||||||
Reference in New Issue
Block a user