]> granicus.if.org Git - python/commitdiff
Avoid trailing blank lines in the output.
authorFred Drake <fdrake@acm.org>
Mon, 19 Nov 2001 05:28:29 +0000 (05:28 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 19 Nov 2001 05:28:29 +0000 (05:28 +0000)
Doc/tools/sgmlconv/docfixer.py

index 8436784f3619d9b2b4fe16af699c1dca21fd43a3..943b2e308b9f476afa6ba5aa39f519ad0d38c298 100755 (executable)
@@ -1022,6 +1022,10 @@ def convert(ifp, ofp):
     # Take care of ugly hacks in the LaTeX markup to avoid LaTeX and
     # LaTeX2HTML screwing with GNU-style long options (the '--' problem).
     join_adjacent_elements(fragment, "option")
+    # Attempt to avoid trailing blank lines:
+    fragment.normalize()
+    if fragment.lastChild.data[-1:] == "\n":
+        fragment.lastChild.data = fragment.lastChild.data.rstrip() + "\n"
     #
     d = {}
     for gi in events.parser.get_empties():