Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Note to self: track changes in #299138
Comment | File | Size | Author |
---|---|---|---|
#8 | html-to-text-loop.txt | 4.43 KB | Jorrit |
Note to self: track changes in #299138
Comment | File | Size | Author |
---|---|---|---|
#8 | html-to-text-loop.txt | 4.43 KB | Jorrit |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedNew patch #299138-155: Improve \Drupal\Core\Utility\Mail::htmlToText()
Comment #2
pillarsdotnet CreditAttribution: pillarsdotnet commentedApplied #299138-157: Improve \Drupal\Core\Utility\Mail::htmlToText() to:
Comment #3
pillarsdotnet CreditAttribution: pillarsdotnet commentedApplied #299138-167: Improve \Drupal\Core\Utility\Mail::htmlToText() to:
Comment #4
pillarsdotnet CreditAttribution: pillarsdotnet commentedLatest is #299138-190: Improve \Drupal\Core\Utility\Mail::htmlToText()
Applied to:
Comment #5
pillarsdotnet CreditAttribution: pillarsdotnet commentedLatest is #299138-198: Improve \Drupal\Core\Utility\Mail::htmlToText()
Comment #6
pillarsdotnet CreditAttribution: pillarsdotnet commentedFull table support added: #299138-230: Improve \Drupal\Core\Utility\Mail::htmlToText()
I can attest that this version does a better job of presenting complex layout than Mozilla Thunderbird in "View message as plain text" mode.
Comment #7
pillarsdotnet CreditAttribution: pillarsdotnet commentedMinor line-wrapping improvements: #299138-232: Improve \Drupal\Core\Utility\Mail::htmlToText()
Comment #8
Jorrit CreditAttribution: Jorrit commentedThe 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?
Comment #9
pillarsdotnet CreditAttribution: pillarsdotnet commented@#8 -- Thanks. I'll check.
Comment #10
pillarsdotnet CreditAttribution: pillarsdotnet commentedThanks 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.
Comment #11
pillarsdotnet CreditAttribution: pillarsdotnet commented#299138-246: Improve \Drupal\Core\Utility\Mail::htmlToText()
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.
Comment #12
Jose Chaves CreditAttribution: Jose Chaves commentedFatal error: Call to undefined function _drupal_html_to_text() in /home/edicoesv/public_html/sites/all/modules/mailsystem/html_to_text.inc on line 559
Comment #13
pillarsdotnet CreditAttribution: pillarsdotnet commentedThanks; fixed.