2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

nroff: Fix fonts for h2, h3, h4.

Without this change, the fonts are wrong if a title contains formatting
like <code> or <var>.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Ben Pfaff
2018-11-08 21:39:54 -08:00
parent 63187cff99
commit a31c38ad0b

View File

@@ -366,14 +366,14 @@ def block_xml_to_nroff(nodes, para='.PP'):
if s != "":
if not s.endswith("\n"):
s += "\n"
nroffTag = {'h1': 'SH',
'h2': 'SS',
'h3': 'ST',
'h4': 'SU'}[node.tagName]
nroffTag, font = {'h1': ('SH', r'\fR'),
'h2': ('SS', r'\fB'),
'h3': ('ST', r'\fI'),
'h4': ('SU', r'\fI')}[node.tagName]
to_upper = node.tagName == 'h1'
s += ".%s \"" % nroffTag
for child_node in node.childNodes:
s += inline_xml_to_nroff(child_node, r'\fR', to_upper)
s += inline_xml_to_nroff(child_node, font, to_upper)
s += "\"\n"
elif node.tagName == 'pre':
fixed = node.getAttribute('fixed')