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

Fix download file with special characters #9670

Merged

Conversation

jonppe
Copy link

@jonppe jonppe commented Sep 24, 2021

Subject: Fix encoding special characters in download filenames

Bugfix

Purpose

  • Allow user to link files with special characters in filename

Relates

#3097

@jonppe jonppe changed the base branch from 4.x to 4.2.x September 24, 2021 12:22
@jonppe jonppe force-pushed the fix-download-file-with-special-characters branch from 8cea5a3 to 857d946 Compare September 24, 2021 12:26
@tk0miya tk0miya changed the base branch from 4.2.x to 4.x September 24, 2021 14:07
@tk0miya tk0miya added this to the 4.3.0 milestone Sep 24, 2021
Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits.

Johannes Aalto added 2 commits September 24, 2021 20:34
Add test to make sure Sphinx uses proper URL encoding for
special characters in file names.

Use test_html_download() since it test_html5_output() doesn't
quite seem to have easy pattern to verify the contents of href
attribute.

Issue sphinx-doc#3097

Signed-off-by: Johannes Aalto <ext-johannes.aalto@vaisala.com>
Properly encode links to files with special characters for the user to
actually be able to download them.

The issue still remains for image files but the logic path
is quite different than with other files fix might involve changes
to docutils.

Fixes sphinx-doc#3097

Signed-off-by: Johannes Aalto <ext-johannes.aalto@vaisala.com>
@jonppe jonppe force-pushed the fix-download-file-with-special-characters branch from 857d946 to b2bd115 Compare September 24, 2021 17:34
@tk0miya tk0miya merged commit d75e317 into sphinx-doc:4.x Sep 25, 2021
tk0miya added a commit that referenced this pull request Sep 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants