Skip to content

Commit

Permalink
Merge pull request #7951 from tk0miya/7745_docname_containing_spaces
Browse files Browse the repository at this point in the history
Fix #7745: html: inventory is broken if the docname contains a space
  • Loading branch information
tk0miya committed Jul 15, 2020
2 parents 6c8d100 + 83eba7e commit ce62756
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -22,6 +22,7 @@ Features added
* #7888: napoleon: Add aliases Warn and Raise.
* C, added :rst:dir:`c:alias` directive for inserting copies
of existing declarations.
* #7745: html: inventory is broken if the docname contains a space
* #7902: html theme: Add a new option :confval:`globaltoc_maxdepth` to control
the behavior of globaltoc in sidebar
* #7052: add ``:noindexentry:`` to the Python, C, C++, and Javascript domains.
Expand Down
3 changes: 2 additions & 1 deletion sphinx/builders/html/__init__.py
Expand Up @@ -15,6 +15,7 @@
import warnings
from os import path
from typing import Any, Dict, IO, Iterable, Iterator, List, Set, Tuple
from urllib.parse import quote

from docutils import nodes
from docutils.core import publish_parts
Expand Down Expand Up @@ -947,7 +948,7 @@ def has_wildcard(pattern: str) -> bool:
# --------- these are overwritten by the serialization builder

def get_target_uri(self, docname: str, typ: str = None) -> str:
return docname + self.link_suffix
return quote(docname) + self.link_suffix

def handle_page(self, pagename: str, addctx: Dict, templatename: str = 'page.html',
outfilename: str = None, event_arg: Any = None) -> None:
Expand Down

0 comments on commit ce62756

Please sign in to comment.