Skip to content

Handle HTML formatted messages better #30

Description

@jimwins

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions