thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/
Apache License 2.0
10.06k stars 2.47k forks source link

K9 HTMLConverter has problem on <HR> replacement on certain mail content #2949

Closed cmeng-git closed 6 years ago

cmeng-git commented 6 years ago

Expected behavior

K9 should display the content of all the normal mail- Gmail is able to display properly for the following text content.

Actual behavior

K9 failed to display the content of the mail: I have traced and found that the following statement failed when executed for \<HR> replacement. HtmlConverter.java line #279: text = ASCII_PATTERN_FOR_HR.matcher(text).replaceAll("\<hr>");

When I commented out the statement, then the mail content displays properly in messaageView window.

=======Content of text captured in debug =========== | Greetings, ceng.<br />|<br />| Your subscriptions on Eclipse Plugins, Bundles and Products - Eclipse<br />Marketplace<br />| notify you of the following changes since the previous digest:<br />|<br />===================================================== 1 of 1 (commented)<br />| Author: pbihler<br />| Title: Enhanced Class Decompiler<br />| Summary:<br /> <br />Enhanced Class Decompiler integrates JD, Jad, FernFlower, CFR, Procyon<br />seamlessly with Eclipse and allows Java developers to debug class files<br />without source code directly. It also integrates with the eclipse class<br />editor, m2e plugin, supports Javadoc, reference search, library source<br />attaching, byte code view and the syntax of JDK8 lambda expression.<br /><br />| LINK: http://marketplace.eclipse.org/content/enhanced-class-decompiler<br />|<br />| Comments: 1<br />| ---------------------------------------------------<br />| Updated comment:<br />| Author: vpanushevj87<br />| Title: Does not integrate with the debugger<br /> <br />Works fine when opening a .class file from the project tree.<br /><br />But when I'm debugging an application and reach a file for which I don't have<br />a source, the decompiler editor is not opened. Instead I see a "Source not<br />found." editor with "Edit Source Lookup Path.." button.<br /><br />.class and .class without source are associated with the Class Decompiler<br />Viewer as suggested in the documentation.<br /><br /> <br /><br />Any setting that I missed. <br /><br />Eclipse Neon.3 Release (4.6.3)<br /><br />| LINK: http://marketplace.eclipse.org/comment/5004#comment-5004<br />| ---------------------------------------------------<br />| Direct unsubscribe link (thread):<br />|<br />http://marketplace.eclipse.org/s/del/node/nid/3644319/-1/50930/cc63503be3e16732be7fdb968ce6e504<br /><br />=====================================================<br />| This is an automated message. Please do NOT reply to the sender address!<br />| To manage your subscriptions go to<br />| http://marketplace.eclipse.org/user/ceng/subscriptions<br /><br />

Steps to reproduce

See above

Environment

K-9 Mail version:5.304

Android version: Android 5.1

Account type (IMAP, POP3, WebDAV/Exchange): IMAP

philipwhiuk commented 6 years ago

Links to code:

https://github.com/k9mail/k-9/blob/ad5897125a1a402fe13036d1b5505c1a177f43d5/k9mail/src/main/java/com/fsck/k9/message/html/HtmlConverter.java#L182

https://github.com/k9mail/k-9/blob/ad5897125a1a402fe13036d1b5505c1a177f43d5/k9mail/src/main/java/com/fsck/k9/message/html/HtmlConverter.java#L279

cketti commented 6 years ago

Same as #3018