-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(message-reader): complex html email rendering incorrectly #10076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rafaeltonholo
merged 8 commits into
thunderbird:main
from
rafaeltonholo:fix/3172/email-html-css-bad-rendering
Nov 19, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2ebce56
chore(message-reader): add :feature:mail:message:reader module
rafaeltonholo 77af91c
chore(message-reader): enable webview debugging on development builds
rafaeltonholo e32bc2e
chore(message-reader): add use_new_message_reader_css_styles feature …
rafaeltonholo 0fefd2d
feat(message-reader): add css classname provider
rafaeltonholo 43a85eb
feat(message-reader): add css variable name provider
rafaeltonholo 1943c5e
feat(message-reader): add css style providers
rafaeltonholo dfdbeed
refactor(message-reader): use CSS providers instead of building css d…
rafaeltonholo d3e565f
chore(message-reader): remove html-cleaner feature project dependency
rafaeltonholo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...et/thunderbird/android/feature/mail/message/reader/api/css/DefaultCssClassNameProvider.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package net.thunderbird.android.feature.mail.message.reader.api.css | ||
|
|
||
| import com.fsck.k9.message.html.EmailTextToHtml | ||
| import net.thunderbird.core.featureflag.FeatureFlagProvider | ||
| import net.thunderbird.feature.mail.message.reader.api.MessageReaderFeatureFlags | ||
| import net.thunderbird.feature.mail.message.reader.api.css.CssClassNameProvider | ||
|
|
||
| class DefaultCssClassNameProvider( | ||
| featureFlagProvider: FeatureFlagProvider, | ||
| override val defaultNamespaceClassName: String, | ||
| ) : CssClassNameProvider { | ||
| override val rootClassName: String = "${defaultNamespaceClassName}__message-viewer" | ||
| override val mainContentClassName: String = "${defaultNamespaceClassName}__main-content" | ||
| override val plainTextMessagePreClassName: String = | ||
| if (featureFlagProvider.provide(MessageReaderFeatureFlags.UseNewMessageReaderCssStyles).isEnabled()) { | ||
| "${defaultNamespaceClassName}__plain-text-message-pre" | ||
| } else { | ||
| EmailTextToHtml.K9MAIL_CSS_CLASS | ||
| } | ||
| override val signatureClassName: String = | ||
| if (featureFlagProvider.provide(MessageReaderFeatureFlags.UseNewMessageReaderCssStyles).isEnabled()) { | ||
| "${defaultNamespaceClassName}__signature" | ||
| } else { | ||
| "k9mail-signature" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../com/fsck/k9/message/html/HtmlSettings.kt → ...ird/core/common/mail/html/HtmlSettings.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ommon/src/commonMain/kotlin/net/thunderbird/core/common/mail/html/HtmlSettingsProvider.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package net.thunderbird.core.common.mail.html | ||
|
|
||
| fun interface HtmlSettingsProvider { | ||
| fun create(): HtmlSettings | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...net/thunderbird/feature/mail/message/composer/html/MessageComposerHtmlSettingsProvider.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package net.thunderbird.feature.mail.message.composer.html | ||
|
|
||
| import net.thunderbird.core.common.mail.html.HtmlSettings | ||
| import net.thunderbird.core.common.mail.html.HtmlSettingsProvider | ||
| import net.thunderbird.core.ui.theme.api.Theme | ||
| import net.thunderbird.core.ui.theme.api.ThemeManager | ||
|
|
||
| interface MessageComposerHtmlSettingsProvider : HtmlSettingsProvider | ||
|
|
||
| internal fun MessageComposerHtmlSettingsProvider(themeManager: ThemeManager): MessageComposerHtmlSettingsProvider = | ||
| object : MessageComposerHtmlSettingsProvider { | ||
| override fun create(): HtmlSettings = HtmlSettings( | ||
| useDarkMode = themeManager.messageComposeTheme == Theme.DARK, | ||
| useFixedWidthFont = false, | ||
| ) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.