Problem/Motivation
We shouldn't have to maintain or own HTML to text code. Especially since we actually don't really do anything about maintaining it.
There was one bugfix in there in there last/this year (for 7.x), one in 2011 and most of the code is unaltered since 2007.
Proposed resolution
Deprecate it in favor of html2text/html2text, which is what swiftmailer.module is already using. Has 450k installs on packagist.
Problem is, it has *very* different opinions on what a plaintext version of a HTML text should look like. Literally every assert in \Drupal\system\Tests\Mail\HtmlToTextTest::testTags() is failing.
I have no idea if that is something that we can do for 8.x, especially thinks like the different link handling. Although that is configurable and other options might be more like our existing output.
Remaining tasks
Look into those test fails, look what of that is OK. We might also want to convert them to unit tests first to make it easier to change.
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2830384-15.patch | 17.35 KB | jungle |
Issue fork drupal-2830384
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
berdirComment #3
berdirComment #5
berdirYeah, this is pretty hopeless :)
with do_links => table, we git input that's more like what we have now (whether or not that is useful output is a different question, though)
And prettty much every single html tag is rendered differently.
Comment #8
andypostLooks it affected by #2223967: Do not decode a contact message twice
Comment #14
junglePostpone on #3165762: Add symfony/mailer into core?
Comment #15
jungleA patch combinated #2 with #3165762.
Comment #22
acbramley commentedThis came up in BSI triage. Should this be considered a bug?
From git history it looks like MailFormatHelper has had a couple of actual changes (i.e not phpcs fixes or other minor changes) in the past few years.
Comment #23
acbramley commented@larowlan had the same comment in slack so changing to a task.