brendonh / pyth

Python text markup and conversion
MIT License
89 stars 79 forks source link

newline for plaintext writer #23

Open flibustenet opened 10 years ago

flibustenet commented 10 years ago

It seems that newline parameter is not used. I can make a pull request, but it's my first use of this tools, so please confirm that i should just replace "\n" by self.newline.

It seems also that it's a bug from rtf to text between newline from paragraph and newline from newline... But i must investigate to see exactly why.

brendonh commented 10 years ago

Yes, the newline parameter does seem to be unused, and probably should be. Please make a pull request.

I'm not sure what you mean by "a bug from rtf to text between newline from paragraph and newline from newline". Can you give me an example?

flibustenet commented 10 years ago
{\rtf1\ansi\ansicpg1252\deff0\deflang1036{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 a\par
b\par
c\par
\par
d\par
e\par
}

with clean_paragraphs=False the result is

a

b

c

d

e

and it should be

a
b
c

d
e

Don't know if it's a problem with plaintext writer (it's ok if i remove self.target.write('\n') from go or from paragraph) or if the problem come from rtf reader.