latex: Do escape_abbr() for author and project

This commit is contained in:
Takeshi KOMIYA 2019-01-07 23:05:43 +09:00
parent 68c90a26f1
commit 46b19b29f3
2 changed files with 6 additions and 6 deletions

View File

@ -473,8 +473,8 @@ def default_latex_documents(config):
""" Better default latex_documents settings. """
return [(config.master_doc,
make_filename_from_project(config.project) + '.tex',
texescape.escape(config.project),
texescape.escape(config.author),
texescape.escape_abbr(texescape.escape(config.project)),
texescape.escape_abbr(texescape.escape(config.author)),
'manual')]

View File

@ -1387,9 +1387,9 @@ def test_default_latex_documents():
from sphinx.util import texescape
texescape.init()
config = Config({'master_doc': 'index',
'project': u'STASI™ Documentation',
'author': u"Wolfgang Schäuble & G'Beckstein"})
'project': 'STASI™ Documentation',
'author': "Wolfgang Schäuble & G'Beckstein."})
config.init_values()
expected = [('index', 'stasi.tex', u'STASI™ Documentation',
u"Wolfgang Schäuble \\& G'Beckstein", 'manual')]
expected = [('index', 'stasi.tex', 'STASI™ Documentation',
r"Wolfgang Schäuble \& G'Beckstein.\@{}", 'manual')]
assert default_latex_documents(config) == expected