From 637ad47e61c51f605a15337b007493586ad37e7f Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 7 Jan 1999 18:47:07 +0000 Subject: 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.) --- Doc/tools/sgmlconv/latex2esis.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 @@ def subconvert(line, ofp, table, discards, autoclosing, endchar=None): 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 subconvert(line, ofp, table, discards, autoclosing, endchar=None): 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 -- cgit v0.12