diff options
author | Fred Drake <fdrake@acm.org> | 1999-01-07 18:47:07 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-01-07 18:47:07 (GMT) |
commit | 637ad47e61c51f605a15337b007493586ad37e7f (patch) | |
tree | 411efd7f8ae1b51fa74d98a31eac528c3566a4ab | |
parent | 446ccfe1ac97f5dc05a0ba89fc0a912981235099 (diff) | |
download | cpython-637ad47e61c51f605a15337b007493586ad37e7f.zip cpython-637ad47e61c51f605a15337b007493586ad37e7f.tar.gz cpython-637ad47e61c51f605a15337b007493586ad37e7f.tar.bz2 |
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.)
-rwxr-xr-x | Doc/tools/sgmlconv/latex2esis.py | 8 |
1 files 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 |