Fix #7325: html: source_suffix containing dot leads to wrong source link

This commit is contained in:
Takeshi KOMIYA 2020-03-18 01:58:56 +09:00
parent 385f7ed40e
commit cc917dcf41
3 changed files with 3 additions and 2 deletions

View File

@ -119,6 +119,7 @@ Bugs fixed
* #7267: autodoc: error message for invalid directive options has wrong location * #7267: autodoc: error message for invalid directive options has wrong location
* #5637: inheritance_diagram: Incorrect handling of nested class names * #5637: inheritance_diagram: Incorrect handling of nested class names
* #7139: ``code-block:: guess`` does not work * #7139: ``code-block:: guess`` does not work
* #7325: html: source_suffix containing dot leads to wrong source link
* #7278: html search: Fix use of ``html_file_suffix`` instead of * #7278: html search: Fix use of ``html_file_suffix`` instead of
``html_link_suffix`` in search results ``html_link_suffix`` in search results
* #7179: std domain: Fix whitespaces are suppressed on referring GenericObject * #7179: std domain: Fix whitespaces are suppressed on referring GenericObject

View File

@ -552,7 +552,7 @@ class StandaloneHTMLBuilder(Builder):
title = self.render_partial(title_node)['title'] if title_node else '' title = self.render_partial(title_node)['title'] if title_node else ''
# Suffix for the document # Suffix for the document
source_suffix = path.splitext(self.env.doc2path(docname))[1] source_suffix = self.env.doc2path(docname, False)[len(docname):]
# the name for the copied source # the name for the copied source
if self.config.html_copy_source: if self.config.html_copy_source:

View File

@ -332,7 +332,7 @@ class BuildEnvironment:
if suffix: if suffix:
warnings.warn('The suffix argument for doc2path() is deprecated.', warnings.warn('The suffix argument for doc2path() is deprecated.',
RemovedInSphinx40Warning) RemovedInSphinx40Warning)
if base not in (True, None): if base not in (True, False, None):
warnings.warn('The string style base argument for doc2path() is deprecated.', warnings.warn('The string style base argument for doc2path() is deprecated.',
RemovedInSphinx40Warning) RemovedInSphinx40Warning)