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.)
This commit is contained in:
Fred Drake 1999-01-07 18:47:07 +00:00
parent 446ccfe1ac
commit 637ad47e61
1 changed files with 5 additions and 3 deletions

View File

@ -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