mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #1498: manpage writer: don't make whole of item in definition list bold if it includes strong node
This commit is contained in:
parent
720c9706de
commit
549b6e27df
1
CHANGES
1
CHANGES
@ -5,6 +5,7 @@ Incompatible changes
|
|||||||
--------------------
|
--------------------
|
||||||
* #2327: `latex_use_parts` is deprecated now. Use `latex_toplevel_sectioning` instead.
|
* #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.
|
* #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
|
Features added
|
||||||
--------------
|
--------------
|
||||||
|
@ -203,6 +203,13 @@ class ManualPageTranslator(BaseTranslator):
|
|||||||
def depart_versionmodified(self, node):
|
def depart_versionmodified(self, node):
|
||||||
self.depart_paragraph(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):
|
def visit_termsep(self, node):
|
||||||
warnings.warn('sphinx.addnodes.termsep will be removed at Sphinx-1.5',
|
warnings.warn('sphinx.addnodes.termsep will be removed at Sphinx-1.5',
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
|
@ -52,3 +52,12 @@ y. y
|
|||||||
#. z
|
#. z
|
||||||
|
|
||||||
#. {
|
#. {
|
||||||
|
|
||||||
|
definition lists
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
term1
|
||||||
|
description
|
||||||
|
|
||||||
|
term2 (**stronged partially**)
|
||||||
|
description
|
||||||
|
@ -21,3 +21,7 @@ def test_all(app, status, warning):
|
|||||||
content = (app.outdir / 'SphinxTests.1').text()
|
content = (app.outdir / 'SphinxTests.1').text()
|
||||||
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
|
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
|
||||||
assert r'\fBmanpage\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
|
||||||
|
Loading…
Reference in New Issue
Block a user