Spoiler text in emails is simply missing

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

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