Skip to content

Commit 3bd83bc

Browse files
authored
fix: allow all url types in referenced exports (#82)
Signed-off-by: Michele Dolfi <[email protected]>
1 parent 8422ad4 commit 3bd83bc

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

docling_core/types/doc/document.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -810,14 +810,8 @@ def export_to_markdown(
810810
):
811811
return default_response
812812

813-
if (
814-
isinstance(self.image.uri, AnyUrl) and self.image.uri.scheme == "file"
815-
) or isinstance(self.image.uri, Path):
816-
text = f"\n![Image]({str(self.image.uri)})\n"
817-
return text
818-
819-
else:
820-
return default_response
813+
text = f"\n![Image]({str(self.image.uri)})\n"
814+
return text
821815

822816
else:
823817
return default_response
@@ -870,14 +864,8 @@ def export_to_html(
870864
):
871865
return default_response
872866

873-
if (
874-
isinstance(self.image.uri, AnyUrl) and self.image.uri.scheme == "file"
875-
) or isinstance(self.image.uri, Path):
876-
img_text = f'<img src="{str(self.image.uri)}">'
877-
return f"<figure>{caption_text}{img_text}</figure>"
878-
879-
else:
880-
return default_response
867+
img_text = f'<img src="{str(self.image.uri)}">'
868+
return f"<figure>{caption_text}{img_text}</figure>"
881869

882870
else:
883871
return default_response

0 commit comments

Comments
 (0)