mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-01 15:02:21 +00:00
updated the handle_image function
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
This commit is contained in:
parent
252bd83066
commit
e5e00674e1
@ -172,7 +172,7 @@ class HTMLDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
elif tag.name == "figure":
|
elif tag.name == "figure":
|
||||||
self.handle_figure(tag, doc)
|
self.handle_figure(tag, doc)
|
||||||
elif tag.name == "img":
|
elif tag.name == "img":
|
||||||
self.handle_image(doc)
|
self.handle_image(tag, doc)
|
||||||
else:
|
else:
|
||||||
self.walk(tag, doc)
|
self.walk(tag, doc)
|
||||||
|
|
||||||
@ -507,6 +507,8 @@ class HTMLDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
content_layer=self.content_layer
|
content_layer=self.content_layer
|
||||||
)
|
)
|
||||||
|
|
||||||
def handle_image(self, doc: DoclingDocument) -> None:
|
def handle_image(self, element: Tag, doc: DoclingDocument) -> None:
|
||||||
"""Handles image tags (img)."""
|
"""Handles image tags (img)."""
|
||||||
|
_log.warning(f"ignoring <img> tags at the moment: {element}")
|
||||||
|
|
||||||
doc.add_picture(parent=self.parents[self.level], caption=None, content_layer=self.content_layer)
|
doc.add_picture(parent=self.parents[self.level], caption=None, content_layer=self.content_layer)
|
||||||
|
Loading…
Reference in New Issue
Block a user