Fix #1498: manpage writer: don't make whole of item in definition list bold if it includes strong node

This commit is contained in:
Takeshi KOMIYA 2016-03-06 17:49:49 +09:00
parent 720c9706de
commit 549b6e27df
4 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,7 @@ Incompatible changes
--------------------
* #2327: `latex_use_parts` is deprecated now. Use `latex_toplevel_sectioning` instead.
* #2337: Use ``\url{URL}`` macro instead of ``\href{URL}{URL}`` in LaTeX writer.
* #1498: manpage writer: don't make whole of item in definition list bold if it includes strong node.
Features added
--------------

View File

@ -203,6 +203,13 @@ class ManualPageTranslator(BaseTranslator):
def depart_versionmodified(self, node):
self.depart_paragraph(node)
# overwritten -- don't make whole of term bold if it includes strong node
def visit_term(self, node):
if node.traverse(nodes.strong):
self.body.append('\n')
else:
BaseTranslator.visit_term(self, node)
def visit_termsep(self, node):
warnings.warn('sphinx.addnodes.termsep will be removed at Sphinx-1.5',
DeprecationWarning)

View File

@ -52,3 +52,12 @@ y. y
#. z
#. {
definition lists
-----------------
term1
description
term2 (**stronged partially**)
description

View File

@ -21,3 +21,7 @@ def test_all(app, status, warning):
content = (app.outdir / 'SphinxTests.1').text()
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
assert r'\fBmanpage\en\fP' in content
# term of definition list including nodes.strong
assert '\n.B term1\n' in content
assert '\nterm2 (\\fBstronged partially\\fP)\n' in content