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

コアに移動しました。

「いいね!」 3

:information_source: Discourse Spoiler Alert はDiscourseコアにバンドルされたため、このプラグインを個別にインストールする必要はなくなりました。 :partying_face:

セルフホストの場合は、ダッシュボードに app.yml から削除する方法に関する情報が表示されるはずです。

:discourse2: 当社でホストされている場合、この変更は一切影響しません。 :+1: このプラグインを引き続きお楽しみいただけますので、ご心配なく。

「いいね!」 1

このプラグインがデフォルトで有効になっている理由がわかりません。映画フォーラムにしか役立たないのではないでしょうか?

映画のネタバレよりも、テキストを隠す理由はたくさんあります。ジョークのオチよりも。

「いいね!」 2

投稿の「いいね」をクリックした後にネタバレコンテンツを表示する機能を追加することは可能ですか?

Feature spoiler-alert のトピックを作成していただくことを歓迎します :wink:

「いいね!」 2

:wink:、向かっています。

ネタバレのプレビューの外観を編集する方法はありますか?現在の実装は見た目が良いですが、ネタバレの内容を十分に抽象化できていません。

以下は、ユーザーがスクリーンショットをアップロードできるスレッドからの例です。スクリーンショットがネタバレの場合、そのようにタグ付けする必要があります。現在の実装では、ゲーム、映画などの重要な瞬間のスクリーンショットにネタバレタグを付けるという文脈では、実際には機能しないことがわかります。

私が共有したゲームに詳しい人なら、それが何であるかをすぐに知るでしょう。

以下の私のディスコースボードからの画像。

これを調整する方法はありますか?

編集: また、ネタバレを含む投稿の編集履歴をクリックすると、編集履歴にはコンテンツのネタバレタグが付けられないこともわかりました。

どのようなものにする予定ですか? よりぼかしますか? ぼかしの色を変えますか?

「いいね!」 1

もしできたら、完全に黒くするか、もっとぼかすかのどちらかにしたいです。

ぼかし部分のデフォルトCSSは以下の通りです。

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

1emをより重要な値に変更してください。

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

カーソルが画像上にあるときにさらにぼかしたい場合は、これらの行を追加し、0.5em(前の値よりも重要度の低い値)を変更してください。

.spoiler-blurred {
  .discourse-no-touch & {
    &:hover, &:focus {
      img {
        filter: blur(0.5em);
      }
    }
  }
}
「いいね!」 4