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

URLs containing parentheses (AKA brackets) get mangled #13424

Open
explode opened this issue Mar 9, 2025 · 0 comments
Open

URLs containing parentheses (AKA brackets) get mangled #13424

explode opened this issue Mar 9, 2025 · 0 comments
Labels

Comments

@explode
Copy link

explode commented Mar 9, 2025

Describe the bug

Typing a URL like https://en.wikipedia.org/wiki/Antenna_(radio) in a ReST document will render to https://en.wikipedia.org/wiki/Antenna_(radio - i.e. the left parenthesis is intact but the right parenthesis is missing, so the URL is broken. Expected behaviour is for https://en.wikipedia.org/wiki/Antenna_(radio) to stay whole. Apparently parentheses are perfectly legal in URLs and very common at sites like Wikipedia and MSDN.

How to Reproduce

Create a Sphinx project and put a demo URL in the index.rst page:

$ mkdir test
$ cd test
$ sphinx-quickstart --no-sep --project "demo" --author "tester" --release 1 --language en .
$ echo "Wikipedia https://en.wikipedia.org/wiki/Antenna_(radio) example" >> index.rst
$ echo "Pct-encoded https://en.wikipedia.org/wiki/Antenna_%28radio%29 version" >> index.rst

Render to HTML:

$ make html
build succeeded.

Test via linkcheck:

$ make linkcheck
(           index: line    9) ok        https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
(           index: line   18) ok        https://en.wikipedia.org/wiki/Antenna_%28radio%29
(           index: line   18) broken    https://en.wikipedia.org/wiki/Antenna_(radio - 404 Client Error: Not Found for url: https://en.wikipedia.org/wiki/Antenna_(radio
build finished with problems.

Environment Information

$ sphinx-build --version
sphinx-build 8.2.1

Sphinx extensions

N/A

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant