Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleRTF2HTMLConverter inserts too many <br/> tags #11

Closed
fadeyev opened this issue Sep 29, 2019 · 2 comments
Closed

SimpleRTF2HTMLConverter inserts too many <br/> tags #11

fadeyev opened this issue Sep 29, 2019 · 2 comments
Labels
Milestone

Comments

@fadeyev
Copy link

fadeyev commented Sep 29, 2019

Not sure what is the purpose of the line 118 in SimpleRTF2HTMLConverter#fetchHtmlSection() :
html = html.replaceAll("[\\n\\r]+", " <br/> ");
However this results in whole lot of extra <br/> tags. And when trying to send an email with such HTML it looks awful with lots of extra lines. However when I replaced <br/> back with a newline \n and sent the email, it looked just like the original.
I tried this on about 10 different emails of various complexity and this replacement of newline with <br/> broke all of them completely, while removing this line fixed them to be just like the originals.

@bbottema
Copy link
Owner

bbottema commented Sep 29, 2019

It's been a while since I looked at the RTF spec, but aren't newlines in RTF encoded with \n\r? That would mean they should be HTML newlines (br's) as well. I see this was in the original sources as well.

/edit Removing that line doesn't seem to cause issues for me in the unit test, but I remember having formatting issues with a chinese email... can't recall the details though, I think I'll remove it since you have more evidence to the contrary.

bbottema added a commit that referenced this issue Sep 29, 2019
@bbottema bbottema added this to the 1.2.2 milestone Sep 29, 2019
@bbottema bbottema added the bug label Sep 29, 2019
@bbottema
Copy link
Owner

bbottema commented Oct 4, 2019

Released v1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants