Avoid trailing blank lines in the output.
diff --git a/Doc/tools/sgmlconv/docfixer.py b/Doc/tools/sgmlconv/docfixer.py
index 8436784..943b2e3 100755
--- a/Doc/tools/sgmlconv/docfixer.py
+++ b/Doc/tools/sgmlconv/docfixer.py
@@ -1022,6 +1022,10 @@
     # 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():