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 Mi Piace

Spostato nel core:

3 Mi Piace

:information_source: Discourse Spoiler Alert è ora incluso in Discourse core, quindi questo plugin non dovrà più essere installato separatamente. :partying_face:

Se self-host, dovresti vedere alcune informazioni nella tua dashboard su come rimuoverlo dal tuo app.yml.

\u003e:discourse2: Ospitato da noi? Questa modifica non ti influenzerà in alcun modo. :+1: Puoi continuare a goderti questo plugin senza preoccuparti di nulla.

1 Mi Piace

Non capisco perché questo plugin sia abilitato per impostazione predefinita. Non è utile solo per i forum di film?

Ci sono molti motivi per nascondere il testo rispetto agli spoiler dei film. Più che le battute finali delle barzellette.

2 Mi Piace

È possibile aggiungere una funzionalità per mostrare il contenuto spoiler dopo aver cliccato su “mi piace” nel post?

Sei più che benvenuto a creare un argomento Feature spoiler-alert :wink:

2 Mi Piace

:wink:, sto arrivando.

C’è un modo per modificare l’aspetto dell’anteprima dello spoiler? L’implementazione attuale è bella, ma non astrae abbastanza per quanto riguarda ciò che sta spoilerando.

Ecco un esempio da un thread che ho creato, dove gli utenti possono caricare i loro screenshot. Se lo screenshot è uno spoiler, deve essere contrassegnato come tale. Come puoi vedere, l’implementazione attuale non funziona davvero nel contesto del tagging spoiler di screenshot di momenti critici nei giochi, film, ecc.

Chiunque abbia familiarità con il gioco che ho condiviso saprebbe immediatamente di cosa si tratta.

Immagine dal mio forum di discussione qui sotto.

C’è un modo per aggiustare questo?

Modifica: Mi è anche stato segnalato che se un utente clicca sulla cronologia delle modifiche di un post che contiene spoiler, la cronologia delle modifiche non contrassegnerà spoiler i contenuti.

Cosa hai intenzione di renderlo? Più sfocato? Un colore diverso della sfocatura?

1 Mi Piace

Se potessi, lo renderei completamente nero, oppure lo sfocerei.

Ecco il CSS predefinito per la parte sfocata

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

Cambia 1em in qualcosa di più importante

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

E se vuoi sfocare di più quando il cursore è sull’immagine, aggiungi queste righe e cambia 0.5em (con un valore meno importante di quello precedente)

.spoiler-blurred {
  .discourse-no-touch & {
    &:hover, &:focus {
      img {
        filter: blur(0.5em);
      }
    }
  }
}
4 Mi Piace