Closed Bug 1659363 Opened 4 years ago Closed 4 years ago

Google calendar event descriptions contain HTML tags but Thunderbird renders descriptions as plain text

Categories

(Calendar :: E-mail based Scheduling (iTIP/iMIP), defect, P2)

Tracking

(thunderbird_esr78+ wontfix, thunderbird80 affected, thunderbird81 fixed, thunderbird83 fixed, thunderbird84 affected)

RESOLVED FIXED
81 Branch
Tracking Status
thunderbird_esr78 + wontfix
thunderbird80 --- affected
thunderbird81 --- fixed
thunderbird83 --- fixed
thunderbird84 --- affected

People

(Reporter: aryx, Assigned: pmorris)

References

Details

Attachments

(4 files, 1 obsolete file)

Thunderbird 78.1.1 on Windows 8.1

Thunderbird's Lightning replaces the content of messages from Google Calendar about event invitations/updates with its own display. Sometimes, it renders the event description with HTML as plain text (right side of screenshot, left side Thunderbird 68.x with Lightning disabled).

From a different email with the issue: The .ics has the description field starting like this:
DESCRIPTION:<br>Password to join the meeting: <span>

Keeping this as a separate bug which is only about not displaying raw HTML.

IIRC the standards do not allow HTML in the description.
Anyway, this causes major problems with Google calendar invites, so we should find a solution.

For bug 1607834, there's also X-ALT-DESC to handle - but at least that's standards compliant.

Assignee: nobody → paul
Priority: -- → P2

Apparently DESCRIPTION is a plain text property in the icalendar spec:
https://icalendar.org/iCalendar-RFC-5545/3-8-1-5-description.html

An HTML version of a description would go in the X-ALT-DESC property (with a FMTTYPE declaration of text/html):
https://stackoverflow.com/questions/854036/html-in-ical-attachment

From discussion with Magnus today, the plan is to leave the content of the property as-is but when displaying it, display it as plain text with any html tags removed. For example, by using parserUtils.convertToPlainText like here: https://searchfox.org/comm-central/rev/568e955cf231f8265491df1ada8800c3d0daaecd/mail/base/content/mailWindow.js#160

Google calendar puts HTML tags into calendar event descriptions,
for formatting etc., but that's not following the iCalendar spec
where DESCRIPTION is plain text. Don't show HTML tags in
descriptions in invitations.

Status: NEW → ASSIGNED

Pushed by paul@paulwmorris.com:
https://hg.mozilla.org/comm-central/rev/c2e7b598699a
Don't show HTML tags in calendar invite event descriptions. r=darktrojan DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
See Also: → 1660260
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
See Also: → 1660225

Google puts HTML tags in calendar event/task DESCRIPTION
properties, so where we display descriptions render them
as HTML rather than just showing the raw plain text.
This commit does this in these places:

  • summary dialog (and ICS import dialog)
  • invitation overlays in emails
  • tooltips shown when mousing over an item.

Depends on D88365

Attachment #9171018 - Attachment is obsolete: true

Going in a different direction. Rather than removing the HTML tags, sanitize and render descriptions as HTML. That way links are preserved and clickable. We need to do this in several places as noted in the commit message for the patch. Plain text URLs are turned into links (as we previously did for the invitation view in an email message). A small behavior change is that "file" urls are no longer linkified (see modified test), but that seems like a worthwhile trade off. I didn't see a way to prevent this from happening.

Summary: event invitation from Google Calendar replaced by Thunderbird, description renders html code as plain text → Google calendar event descriptions contain HTML tags but Thunderbird renders descriptions as plain text

Comment on attachment 9172305 [details]
Bug 1659363 - Render HTML in calendar item descriptions. r=darktrojan

Richard, could you take a look at the CSS for theme-ability? Namely the white background of the description and the blue link color, which I think will need some adjustment.

Attachment #9172305 - Flags: feedback?(richard.marti)

Comment on attachment 9172305 [details]
Bug 1659363 - Render HTML in calendar item descriptions. r=darktrojan

Looks good. Yes, white as background isn't so optimal with a dark theme. I'll attach a fixed CSS file you can then update on Phabricator.

Attachment #9172305 - Flags: feedback?(richard.marti) → feedback+

Updated CSS file with better colours.

Thanks Richard! I've added your CSS changes to the latest revision of the patch.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/f78b8f5ae8b1
Fix some typos in comments in chat code. r=clokep
https://hg.mozilla.org/comm-central/rev/d1bccebf5b42
Render HTML in calendar item descriptions. r=darktrojan

Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED

I tried a nightly build and I can't await the day of it appearing in the release channel!!!
THANKS!

Blocks: 1663947

We should take this for 78, but let's polish some more first (bug 1663947 at least).

Hello, I understand that these commits will allow clicking on links in the description of an event, right? It is indeed more and more useful with the increase of online meetings and link to Jitsi, Zoom, Teams, Google meet and other platforms... Really appreciated, thanks!
When do you plan to release it?

Temporary backout

Thunderbird 83.0b2:
https://hg.mozilla.org/releases/comm-beta/rev/7c2924f35b3e

NI :wsmwk since we need to remember to reapply this on beta once bug 1673164 is fixed.

Flags: needinfo?(vseerror)

Can this now be brought back, as bug1673164 appears as fixed

Yes, it's lined up for the next beta.

Restored in Thunderbird 83.0b3:
https://hg.mozilla.org/releases/comm-beta/rev/1bfa718a7cd3

Flags: needinfo?(vseerror)
Regressions: 1666296

We should take this for 78, but let's polish some more first (bug 1663947 at least).

Will this ever be brought into 78?

Hello. Thanks for working on this. I'm running 86.0b1 and unfortunately the commit above doesn't seem to work for Microsoft Teams invitations. Teams saves links in the DESCRIPTION field sourrounded by left and right angle brackets (<) and (>). The introduced 'textToHtmlDocumentFragment' function fails to recognize this (assumably because it thinks a html tag is about to start) and removes the link instead, which is worse than at least having the text version. If you remove those brackets manually, the link is recognized correctly.

Interestingly the main email window of Thunderbird already handles that scenario correctly. Whether your email contains <www.google.com> or www.google.com it always recognizes the link and just ignores the brackets.

...
DESCRIPTION;LANGUAGE=en-US:\n\n______________
__________________________________________________________________\nMicros
oft Teams-Meeting\nJoin on your computer or mobile app\nClick here\,
to join the meeting<https://teams.microsoft.com/l/meetup-j
oin/19%3ameeting_ODFmOGFmMGItZjA3OC66MGVjLTllMzItNDNmM2QxNzViOTg1%40thread
.v2/0?context=%7b%22Tid%22%3a%222f1bf2a7-730e-4228-82d5-440fbfcb419a%22%2c
%22Oid%22%3a%229a3157f6-b6ff-4f1b-894d-baf81555bfb0%22%7d>\n ...

The teams problem is bug 1666296.

Hi Magnus, yes I've seen that. But since this commit's function was to find and convert links in plain text and it doesn't do that in this corner case (that may or may not be Teams exclusive), I thought this would be the right place. I will report it in bug 1666296 too. Thanks.

See Also: → 1670187
Blocks: 1670187
See Also: 1670187
See Also: → 1792078
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: