Skip to content

[Feature] Option to strip HTML emails of tags #6

Description

@snipsnipsnip

Add a toggle to let users edit an HTML email as if it were a plain text email.

Why complicate the situation? I think it's convenient to be able to switch them from the toolbar rather than having to tweak settings for each email.

In principle, Ghostbird is just a pipe between Thunderbird and the text editor, and so doesn't mess with the supplied text. But sometimes we have to preprocess the text before and after editing to show the text as the user intended.

The required processing differs depending on:

  • User preference (whether they want to edit as plain text always or HTML as is)
  • Composition email format (Thunderbird composes each email as either plain text or HTML)
  • Direction (reading from the compose window or writing into it)

As of alpha version, current behavior can be described as it assumes Thunderbird's composition email format always matches the user preference.

This preprocessing will be a bit more complex in #8 and #12.

  • When reading from the compose window
Email format→
User preference↓
Plain text HTML
Plain text Read body.textContent as is Read body.innerHTML and strip tags off*
HTML Read body.textContent as is Read body.innerHTML as is

* Thunderbird provides an API to do this, so we should try it first. Or maybe it's equivalent to do getComposeDetails() and get the plainTextBody from it.

  • When writing back into the compose window
Email format→
User preference↓
Plain text HTML
Plain text Write body.textContent as is Write body.textContent
or maybe wrap paragraphs as <p> tags and write to body.innerHTML
HTML Write body.textContent as is Write body.innerHTML as is

I hope we won’t have to parse HTML, but we need to experiment to see how much broken HTML Thunderbird can tolerate.

Activity

  1. converted this from a draft issue on Sep 11, 2025
  2. moved this from Backlog to Ready in Ghostbird Issueson Sep 13, 2025
  3. moved this from ⛳️Ready to 🪵Backlog in Ghostbird Issueson Sep 13, 2025
  4. changed the title [-]Smoother editing of HTML emails[/-] [+]Option to strip HTML emails of tags[/+] on Sep 17, 2025
  5. changed the title [-]Option to strip HTML emails of tags[/-] [+][Feature] Option to strip HTML emails of tags[/+] on Oct 2, 2025
  6. moved this from 🪵Backlog to 🚧 WIP in Ghostbird Issueson Oct 18, 2025
  7. self-assigned this
    on Oct 26, 2025
  8. moved this from 🚧 WIP to 🪺Experimental in Ghostbird Issueson Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions