[ovs-dev] [PATCH] xml2nroff: Fix formatting of action headers in ovs-actions(7) manpage.

Ben Pfaff blp at ovn.org
Wed Apr 14 20:40:20 UTC 2021


The action headings were coming out all smashed together, like
"Theoutputaction".  This fixes them so that they appear correctly, like
"The output action".

The previous code stripped starting and ending spaces on a per-node
basis, so that "The ", "<code>output</code>", and " action" each got
stripped down to "The", "output", "action" after processing.  This
commit changes it so that stripping happens after concatenation, fixing
the problem.

Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 python/build/nroff.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/python/build/nroff.py b/python/build/nroff.py
index 09795ab52bec..0a18227e2887 100644
--- a/python/build/nroff.py
+++ b/python/build/nroff.py
@@ -377,10 +377,9 @@ def block_xml_to_nroff(nodes, para='.PP'):
                                   'h4': ('SU', r'\fI')}[node.tagName]
                 to_upper = node.tagName == 'h1'
                 s += ".%s \"" % nroffTag
-                for child_node in node.childNodes:
-                    s += flatten_header(
-                        inline_xml_to_nroff(child_node, font, to_upper)
-                    )
+                s += flatten_header(''.join([
+                    inline_xml_to_nroff(child_node, font, to_upper)
+                    for child_node in node.childNodes]))
                 s += "\"\n"
             elif node.tagName == 'pre':
                 fixed = node.getAttribute('fixed')
-- 
2.29.2



More information about the dev mailing list