# Spoiler text in emails is simply missing

**URL:** https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826
**Category:** Bug
**Created:** [09.Апрель.2019 04:04:52 UTC](https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826 "2019-04-09T04:04:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [09.Апрель.2019 04:04:52 UTC](https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826/1 "2019-04-09T04:04:52Z")

</div>

Apropos [this old bug](https://github.com/discourse/discourse-spoiler-alert/commit/ccd767ed908c426519fd608014254b1dfa4c5efa), 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.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [09.Апрель.2019 04:06:45 UTC](https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826/2 "2019-04-09T04:06:45Z")

</div>

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.

```plaintext
----==_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.)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [09.Апрель.2019 05:34:38 UTC](https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826/3 "2019-04-09T05:34:38Z")

</div>

This request is very much in the vain of:

> [@Mailing list mode: "Upload" links broken (?) in e-mails](https://meta.discourse.org/t/mailing-list-mode-upload-links-broken-in-e-mails/112354):
>
> Hello, I’m subscribed to the Rust forums, which use Discourse, and after first submitting this bug there, I was suggested to post it here: On the Rust Discourse forums I have “Mailing list mode” enabled in my preferences, and also “Include previous replies at the bottom of emails”. In the plain-text (non-HTML) version of such e-mails, the replies for a thread (e.g. [Ideas for a Rayon logo - #17 - community - The Rust Programming Language Forum](https://users.rust-lang.org/t/ideas-for-a-rayon-logo/26323/17)) have links to images of the form upload://... whi…

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.

---

<div class="post-metadata">

### Author: ![distfp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/distfp/32/134853_2.png) [@distfp](https://meta.discourse.org/u/distfp)
#### Post date: [09.Апрель.2019 09:09:59 UTC](https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826/4 "2019-04-09T09:09:59Z")

</div>

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]

> **[What could a "spoiler tag" extension look like?](https://talk.commonmark.org/t/what-could-a-spoiler-tag-extension-look-like/767/84)**
>
> Discord have now added support for spoilers, but they are using the ||spoiler|| syntax instead. I think this really needs standardising. @aoudad I like the block spoiler there, but the inline one looks weird.

[2] [GitHub - damiencollard/discourse-article: Discourse article treatment for Gnus · GitHub](https://github.com/damiencollard/discourse-article)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [09.Апрель.2019 19:52:18 UTC](https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826/5 "2019-04-09T19:52:18Z")

</div>

> [@sam](#):
>
> The HTML issue though is easy to correct.

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

> <https://github.com/discourse/discourse-spoiler-alert/blob/095484835a8d3fc33c5abfa8fc626c0aadcd736f/plugin.rb#L14-L19>

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

> [@sam](#):
>
> @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.

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.

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [27.Май.2019 12:16:30 UTC](https://meta.discourse.org/t/spoiler-text-in-emails-is-simply-missing/113826/17 "2019-05-27T12:16:30Z")

</div>


