10000 fix: Quote referenced URIs in markdown and html by cau-git · Pull Request #122 · docling-project/docling-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Quote referenced URIs in markdown and html #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from io import BytesIO
from pathlib import Path
from typing import Any, Dict, Final, List, Literal, Optional, Tuple, Union
from urllib.parse import unquote
from urllib.parse import quote, unquote

import pandas as pd
import yaml
Expand Down Expand Up @@ -830,7 +830,7 @@ def export_to_markdown(
):
return default_response

text = f"\n![Image]({str(self.image.uri)})\n"
text = f"\n![Image]({quote(str(self.image.uri))})\n"
return text

else:
Expand Down Expand Up @@ -884,7 +884,7 @@ def export_to_html(
):
return default_response

img_text = f'<img src="{str(self.image.uri)}">'
img_text = f'<img src="{quote(str(self.image.uri))}">'
return f"<figure>{caption_text}{img_text}</figure>"

else:
Expand Down
Loading
0