Handle HTML formatted messages better
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 12
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Currently, messages with a text/html part but no text/plain are just run through strip_tags() to remove all tags.
HTML email isn't going away, so we could handle it better, especially with the new HTML parsing capabilities in PHP 8.4. We could parse it, strip it down to just tags we want to allow, and mark those up with classes so it gets styled reasonably (like quoting levels).
It may even make sense to favor the text/html format when we get both. For example, this message has a text/plain part that is totally devoid of formatting, but the HTML is already pretty simple (div, blockquote, etc).
(My goal with this is to present the messages that are sent to the PHP lists, particularly internals@, as usefully as we can, which means I'm willing to go to special lengths to handle what is actually being sent by active participants. https://externals.io gets pretty far with just shoving all the plain-text through Markdown, but I'd like to do better.)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the message-rendering path that currently sends HTML-only parts through strip_tags(), and review the PHP 8.4 HTML parsing capabilities mentioned in the issue. Done means HTML-only messages are handled with an allowlisted, styled subset of markup, with a clear decision about when HTML should be preferred over plain text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100