Note to self: track changes in #299138

#8 html-to-text-loop.txt4.43 KBJorrit


Full table support added: #299138-230: Improve drupal_html_to_text()

I can attest that this version does a better job of presenting complex layout than Mozilla Thunderbird in "View message as plain text" mode.

Applied to Mail System
6.x-2.22 release
7.x-2.22 release
8.x-2.22 release

new4.43 KB

The latest version is not working well with nested tables. The do { } while($width > 2) loop is taking a lot of time, more than 30 seconds on my server. I have removed all unnecessary parts from the HTML code such that the problem occurs. I have tried to find the problem, but the code is too vague for me.

Maybe I should put this report in #299138, but I see that there are some fixes made to table conversion after June 4th, 2011. Maybe you can check if the attached file parses properly for the new version?

Status:Active» Needs work

@#8 -- Thanks. I'll check.

Thanks very much for the test case; I've added it to the tests for the new version.

I've replaced the linear search with a binary search, and your test case helped me find a few bugs in nested table parsing.

#299138-246: Improve drupal_html_to_text()
Improved table generation accuracy and performance.
Added test for correctly formed deeply-nested tables.
Test also asserts that table generation takes less than one second.

Applied to Mail System

Fatal error: Call to undefined function _drupal_html_to_text() in /home/edicoesv/public_html/sites/all/modules/mailsystem/ on line 559

Thanks; fixed.

Applied to Mail system