Discourse Spoiler Alert provides the ability to hide content marked with a [spoiler] tag in posts.
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:
Features
Once enabled it adds a ‘Blur Spoiler’ option to the 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:
[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
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)
O Discourse Spoiler Alert agora está incluído no core do Discourse, portanto, este plugin não precisará mais ser instalado separadamente.
Se você auto-hospeda, verá algumas informações no seu painel sobre como removê-lo do seu app.yml.
\u003e:discourse2: Hospedado por nós? Esta alteração não afetará você de forma alguma. Você pode continuar aproveitando este plugin e não se preocupar com nada.
Existe alguma maneira de editar a aparência da prévia do spoiler? A implementação atual é boa, mas não abstrai o suficiente quanto ao que está sendo revelado.
Aqui está um exemplo de um tópico que criei, onde os usuários podem fazer upload de suas capturas de tela. Se a captura de tela for um spoiler, ela precisa ser marcada como tal. Como você pode ver, a implementação atual não funciona realmente no contexto de marcar capturas de tela de momentos críticos em jogos, filmes, etc., como spoilers.
Qualquer pessoa familiarizada com o jogo que compartilhei saberia imediatamente do que se trata.
Editar: Também cheguei ao conhecimento que, se algum usuário clicar no histórico de edição de uma postagem que contém spoilers, o histórico de edição não marcará o conteúdo como spoiler.
E se você quiser desfocar mais quando o cursor estiver sobre a imagem, adicione estas linhas e altere o 0.5em (com um valor menos importante que o anterior)