Spoiler text in emails is simply missing

AI-generated summary

In this bug report, dfabulich highlights that spoiler text in email notifications is now completely missing — previously it was blacked out — and notes that in the text/plain email part, spoiler tags appear as raw BBCode (e.g., [spoiler]...[/spoiler]) instead of being masked. sam compares this to similar parsing issues in emails and notes that while the HTML rendering of spoilers is fixable, the text/plain part is more complex. zogstrip confirms that spoilers were intentionally blacked out in HTML emails for better UX, recalling past discussions where three options were considered: removal, blacking out, or replacing with a link. zogstrip requests nbianca to verify no regression occurred and to add tests to prevent recurrence. Separately, distfp reports receiving an email with [details="Spoiler"] syntax instead of [spoiler], questioning which format to support in their Discourse extension, noting that spoiler syntax isn’t yet standardized in CommonMark.

Apropos this old bug, I noticed that spoiler text in emails is simply missing. Previously it used to be blacked out, but now the spoiler text is just completely gone.

This is definitely a regression, but I’m not 100% sure when it started.

2 Likes

Viewing the source of an email notification with missing spoilers, I also noticed that the spoiler text is being displayed as untransformed BBCode in the text/plain part of the email.

----==_mimepart_5cac17b21ca40_bb3fd885b9edd8477149
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit



[spoiler]This text will be blurred[/spoiler]

I think that text should be replaced with asterisks or something. (I’m not sure if this is a regression or not.)

This request is very much in the vain of:

Has the same general problem of needing to have a smart markdown parser that parses our raw markdown and converts it to a different raw markdown format.

The HTML issue though is easy to correct. The text part is very tricky.

@zogstrip do you have any more context around the complete removal of spoilers from email html? I do recall we had some discussion about this in the past.

4 Likes

As it happens, I just received an e-mail from a Discourse forum that
contained a spoiler block! However the syntax wasn’t
[spoiler]...[/spoiler] but [details="Spoiler"]...[/details].

From what I’ve read[1] spoilers don’t seem to be standardised in
CommonMark yet, but is one of the above forms superseding the other?

If I were to add support for spoiler blocks in my Discourse Article
extensions for Gnus[2], should I handle [spoiler] or
[details="Spoiler"]… or both?

Footnotes:
[1]

[2] GitHub - damiencollard/discourse-article: Discourse article treatment for Gnus · GitHub

2 Likes

@nbianca can you ensure we haven’t regressed in properly “blacking out” spoiler in HTML emails?

We should add a test as well since we’ve regressed more than once on this one :frowning:

I remember we thought about 3 options

  1. completely removing spoilers
  2. blacking out spoilers
  3. replacing the content of the spoiler with a link to the post

I remember doing 2 because it was easier than 3 but provided a better UX than 1.

2 Likes