Bug 375314 - "Toggle HTML Display Mode" button does not work with HTML enabled by default
Summary: "Toggle HTML Display Mode" button does not work with HTML enabled by default
Status: CONFIRMED
Alias: None
Product: kmail2
Classification: Applications
Component: commands and actions (show other bugs)
Version: 5.4.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-19 20:00 UTC by Matthijs
Modified: 2024-10-23 08:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthijs 2017-01-19 20:00:23 UTC
I set KMail to display HTML email by default. This works fine, but since switching to a dark colorscheme, some e-mails are a bit problematic.

So I added the "Toggle HTML Display Mode" button to my toolbar, but it does not work: KMail shows the HTML email with the button either enabled or disabled. 

I tested the feature with HTML email disabled by default, and then it does work.
Comment 1 null 2020-04-09 15:15:46 UTC
I can reproduce this bug with KMail 5.9.2 (Qt 5.11.2 / KF 5.51) as well as KMail 5.14.40 (Qt 5.14.1 / KF 5.69), i.e. if "Prefer HTML" is turned on globally, activating the toggle HTML action to temporarily switch to plain text does nothing.

This is regardless of whether I use the toolbar action, a shortcut or by clicking on the HTML status bar itself.

FWIW, sometimes the following message is logged after every click on the HTML status bar, although I'm not sure whether this is related at all:
WebEnginePage::javaScriptConsoleMessage lineNumber:  19  message:  "Uncaught TypeError: Cannot read property 'compareDocumentPosition' of null"
Comment 2 Geert Janssens 2024-10-23 08:51:37 UTC
I ran into this issue today as well. I am currently using KMail 5.24.5 (23.08.5) on Fedora 39. This version no longer has a toolbar action to toggle html any more, only the HTML status bar.

I see the same behaviour Matthijs explains:

* If HTML mail is enabled by default (regardless whether that's globally enabled or for the current folder) it's impossible to switch to the plain text version. Clicks on the HTML status bar have no effect.
* If HTML mail is disabled by default (again regardless of whether that's globally disabled or only for the current folder) one can toggle the display mode by clicking on the HTML status bar. In this configuration I toggling works both ways, that is from text view to html view and with a subsequent click from html view back to text view.

I  would love to see this fixed. I generally prefer html view, but some mails fail to render in html view (which I reported in Bug 495004). So my only option in that case is to look at the plain text view (until the other bug is fixed). As it stands this is very cumbersome right now because the toggle actions isn't working.