diff --git a/CHANGES b/CHANGES index e37afeda2..4b28899b2 100644 --- a/CHANGES +++ b/CHANGES @@ -64,6 +64,11 @@ New features added - The default value for ``htmlhelp_basename`` is now the project title, cleaned up as a filename. + - The new ``trim_footnote_reference_space`` config value mirrors + the docutils config value of the same name and removes the + space before a footnote reference that is necessary for reST + to recognize the reference. + * Builders: - New builder for Qt help collections, by Antonio Valentino. diff --git a/doc/config.rst b/doc/config.rst index dd25cf223..8fc7978c3 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -261,7 +261,14 @@ Project information A boolean that decides whether :dir:`moduleauthor` and :dir:`sectionauthor` directives produce any output in the built files. +.. confval:: trim_footnote_reference_space + Trim spaces before footnote references that are necessary for the reST parser + to recognize the footnote, but do not look too nice in the output. + + .. versionadded:: 0.6 + + .. _html-options: Options for HTML output diff --git a/sphinx/config.py b/sphinx/config.py index e1eb8ec8f..a3de68f5a 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -45,6 +45,7 @@ class Config(object): default_role = (None, True), add_function_parentheses = (True, True), add_module_names = (True, True), + trim_footnote_reference_space = (False, True), show_authors = (False, True), pygments_style = ('sphinx', False), highlight_language = ('python', False), diff --git a/sphinx/environment.py b/sphinx/environment.py index a654cb778..991fab72d 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -59,7 +59,7 @@ default_settings = { # This is increased every time an environment attribute is added # or changed to properly invalidate pickle files. -ENV_VERSION = 27 +ENV_VERSION = 28 default_substitutions = set([ @@ -517,6 +517,8 @@ class BuildEnvironment: self.docname = docname self.settings['input_encoding'] = self.config.source_encoding + self.settings['trim_footnote_reference_space'] = \ + self.config.trim_footnote_reference_space class SphinxSourceClass(FileInput): def read(self):