Skip to content
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

URI-escape image filenames #10268

Merged
merged 23 commits into from Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion sphinx/writers/html.py
Expand Up @@ -612,7 +612,7 @@ def visit_image(self, node: Element) -> None:
# rewrite the URI if the environment knows about it
if olduri in self.builder.images:
node['uri'] = posixpath.join(self.builder.imgpath,
self.builder.images[olduri])
urllib.parse.quote(self.builder.images[olduri]))

if 'scale' in node:
# Try to figure out image height and width. Docutils does that too,
Expand Down
2 changes: 1 addition & 1 deletion sphinx/writers/html5.py
Expand Up @@ -560,7 +560,7 @@ def visit_image(self, node: Element) -> None:
# rewrite the URI if the environment knows about it
if olduri in self.builder.images:
node['uri'] = posixpath.join(self.builder.imgpath,
self.builder.images[olduri])
urllib.parse.quote(self.builder.images[olduri]))

if 'scale' in node:
# Try to figure out image height and width. Docutils does that too,
Expand Down