mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
texinfo: remove DOTs from name if name contains other characters
This commit is contained in:
parent
133ed17de6
commit
e483e4afc3
@ -387,6 +387,9 @@ class TexinfoTranslator(nodes.NodeVisitor):
|
||||
bad_chars = ',:()'
|
||||
for bc in bad_chars:
|
||||
s = s.replace(bc, ' ')
|
||||
if re.search('[^ .]', s):
|
||||
# remove DOTs if name contains other characters
|
||||
s = s.replace('.', ' ')
|
||||
s = ' '.join(s.split()).strip()
|
||||
return self.escape(s)
|
||||
|
||||
|
@ -110,5 +110,5 @@ def test_texinfo_escape_id(app, status, warning):
|
||||
assert translator.escape_id('Hello Sphinx world') == 'Hello Sphinx world'
|
||||
assert translator.escape_id('Hello:world') == 'Hello world'
|
||||
assert translator.escape_id('Hello(world)') == 'Hello world'
|
||||
assert translator.escape_id('Hello world.') == 'Hello world.'
|
||||
assert translator.escape_id('Hello world.') == 'Hello world'
|
||||
assert translator.escape_id('.') == '.'
|
||||
|
Loading…
Reference in New Issue
Block a user