convert(): Make sure no line has trailing whitespace. (docfixer.py
checks for \n\n as a paragraph separator, LaTeX allows white
space between the newlines.)
diff --git a/Doc/tools/sgmlconv/latex2esis.py b/Doc/tools/sgmlconv/latex2esis.py
index f3c39f5..4a86747 100755
--- a/Doc/tools/sgmlconv/latex2esis.py
+++ b/Doc/tools/sgmlconv/latex2esis.py
@@ -53,8 +53,6 @@
ofp.write("- %s \n" % encode(text))
ofp.write(")COMMENT\n")
ofp.write("-\\n\n")
-## else:
-## ofp.write("-\\n\n")
line = line[m.end():]
continue
m = _begin_env_rx.match(line)
@@ -250,8 +248,12 @@
def convert(ifp, ofp, table={}, discards=(), autoclosing=()):
+ lines = string.split(ifp.read(), "\n")
+ for i in range(len(lines)):
+ lines[i] = string.rstrip(lines[i])
+ data = string.join(lines, "\n")
try:
- subconvert(ifp.read(), ofp, table, discards, autoclosing)
+ subconvert(data, ofp, table, discards, autoclosing)
except IOError, (err, msg):
if err != errno.EPIPE:
raise