Discourse Spoiler-Alert

:discourse2: Summary Discourse Spoiler Alert provides the ability to hide content marked with a [spoiler] tag in posts.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Enabling Spoiler Alert

This plugin is default enabled once installed but can be disabled/enabled from its settings, accessed from your admin/plugins page:

enable spoiler

Features

Once enabled it adds a ‘Blur Spoiler’ option to the :gear: menu in the composer’s formatting bar. Simply highlight the text you’d like to blur and select ‘blur spoiler’ and it will wrap the selected text in the necessary [spoiler] tags:

Examples:

Inline:

[spoiler]This is a spoiler[/spoiler] 

This is a spoiler

Multiline:

[spoiler]

I wanna be your vacuum cleaner
Breathing in your dust
I wanna be your Ford Cortina
I will never rust
If you like your coffee hot
Let me be your coffee pot
You call the shots
I wanna be yours

https://johncooperclarke.com/poems/i-wanna-be-yours

[/spoiler]

I wanna be your vacuum cleaner
Breathing in your dust
I wanna be your Ford Cortina
I will never rust
If you like your coffee hot
Let me be your coffee pot
You call the shots
I wanna be yours

https://johncooperclarke.com/poems/i-wanna-be-yours

Clicking on the blur will reveal the hidden text, and clicking again will re-blur it.

It also works for images:
(to re-blur an image that is large enough to generate a lightbox, you can click on the adjacent white space or refresh the page)

Settings

Name Description
spoiler enabled Enable the spoiler plugin. If you change this, you must rebake all posts with: “rake posts:rebake”[1]

:discourse2: Hosted by us? This plugin is available on all of our hosting tiers Spoiler Alert | Discourse - Civilized Discussion


  1. :discourse2: If you’re a hosted customer of ours, please contact team@discourse.org if you have any questions about needing to ‘rebake’ due to a setting change ↩︎

Last edited by @tobiaseigen 2025-07-16T20:45:02Z

Check documentPerform check on document:
48개의 좋아요

Moved to core:

https://github.com/discourse/discourse/commit/89580ee379945c36283379d105517ba2f00ac6a7

3개의 좋아요

:information_source: Discourse Spoiler Alert has now been bundled with Discourse core, so this plugin will no longer need to be installed separately. :partying_face:

If you self-host you should see some information on your dashboard about removing it from your app.yml.

:discourse2: Hosted by us? This change will not affect you in any way. :+1: You can continue to enjoy this plugin and not worry about a thing.

1개의 좋아요

I don’t understand why this plugin is enabled by default. Isn’t it only useful for movie forums?

There are plenty of reason to hide text than movie spoilers. More than punchlines of jokes.

2개의 좋아요

Is it possible to add a feature to show the spoiler content after clicking ‘like’ on the post?

You’re more than welcome to create a Contribute > Feature spoiler-alert topic :wink:

2개의 좋아요

:wink:, I’m on my way.

Is there anyway to edit the contents of how the spoiler preview looks? The current implementation looks nice, but it doesn’t abstract enough as far as what it’s spoiling.

Here’s an example from a thread I made, where users can upload their screenshots. If the screenshot is a spoiler, it needs to be tagged as such. As you can tell, the current implementation doesn’t really work in the context of spoiler tagging screenshots of critical moments in games, movies, etc.

Anyone who is familiar with the game I shared would immediately know what it is.

Image from my discourse board below.

Is there a way to adjust this?

Edit: It’s also come to my attention that if any user clicks the edit history of a post that contains spoilers, the edit history will not spoiler tag the contents.

What are you planning to make it like? More blurry? A different color of the blur?

1개의 좋아요

If I could, I’d either turn it completely black, or make it blurrier.

Here is the default css for the blur part

.spoiler-blurred img {
  filter: blur(1em);
}

Change the 1em to something more important

.spoiler-blurred img {
  filter: blur(5em);
}

And if you want to blur more when the cursor is on the image, add these line and change the 0.5em (with a value less important than the one before)

.spoiler-blurred {
  .discourse-no-touch & {
    &:hover, &:focus {
      img {
        filter: blur(0.5em);
      }
    }
  }
}
5개의 좋아요

이것이 별도의 버그 리포트로 가치가 있는지 확실하지 않지만, 채팅 푸시 알림을 통해 스포일러 텍스트가 다른 모든 경우와 달리 가려지지 않는다는 사실을 깨달았습니다. Chat::Message#push_notification_excerpt는 원시 마크다운을 잘라내고, 스포일러를 this is a chat notification [spoiler]and this is the spoiler[/spoiler]처럼 문자 그대로 출력합니다. 알림에 스포일러 전체가 출력된다면 스포일러 태그의 목적이 사실상 무색해지죠! :joy: 스포일러 경고의 :reduce_excerpt가 채팅 메시지의 경우 포럼 게시글과 달리 완전히 우회되는 것 같아 실수처럼 보입니다. 채팅에서는 그 외에는 정상적으로 작동합니다! 문제가 있는 것은 푸시 알림입니다.