mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-02 15:32:30 +00:00
Improvements in md parsing
Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
parent
534b2203f6
commit
bef429fee3
@ -130,6 +130,30 @@ class MarkdownDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
caption=element.title
|
caption=element.title
|
||||||
)
|
)
|
||||||
|
|
||||||
|
elif isinstance(element, marko.inline.RawText):
|
||||||
|
print(f" - Paragraph (raw text): {element.children}")
|
||||||
|
snippet_text = str(element.children)
|
||||||
|
doc.add_text(
|
||||||
|
label=DocItemLabel.PARAGRAPH,
|
||||||
|
parent=parent_element,
|
||||||
|
text=snippet_text
|
||||||
|
)
|
||||||
|
|
||||||
|
elif isinstance(element, marko.inline.CodeSpan):
|
||||||
|
print(f" - Paragraph (code): {element.children}")
|
||||||
|
snippet_text = str(element.children)
|
||||||
|
doc.add_text(
|
||||||
|
label=DocItemLabel.PARAGRAPH,
|
||||||
|
parent=parent_element,
|
||||||
|
text=snippet_text
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
if not isinstance(element, str):
|
||||||
|
print("Something else: {}".format(element))
|
||||||
|
# print(element)
|
||||||
|
|
||||||
|
# elif isinstance(element, marko.block.Table):
|
||||||
|
# print(" - Table")
|
||||||
# elif isinstance(element, marko.block.Table):
|
# elif isinstance(element, marko.block.Table):
|
||||||
# print(" - Table")
|
# print(" - Table")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user