Markdown Spoiler Syntax for Every Platform (2026)

November 11, 2026 · 9 min read

Markdown Spoiler Syntax: Hide Text on Every Platform

There's no markdown spoiler tag in standard Markdown. CommonMark and GitHub Flavored Markdown define nothing for hidden text. Each app invents its own marker: ||text|| on Discord and in Telegram bot messages, >!text!< on Reddit, [spoiler] on Discourse. Where no marker exists, such as GitHub, a collapsed <details> block does the job.

Is There a Spoiler Tag in Standard Markdown?

No. The CommonMark spec has no spoiler construct, and GitHub Flavored Markdown adds extras such as tables, task lists and strikethrough, but nothing for hidden text. Every spoiler you've seen is a platform extension that its own parser understands and every other parser ignores.

That's why the same message looks fine in one app and broken in another. Two inline families cover most chat and forum apps:

The killer is ||Colonel Mustard||.
The killer is >!Colonel Mustard!<.

On Discord the first line hides the name behind a dark box. On Reddit the second line does the same. Paste both into a CommonMark parser and you get the raw characters back, pipes and all.

A third group works on whole blocks instead of words: Stack Exchange's quote-style spoiler, Lemmy's ::: container and the HTML <details> element.

Markdown Spoiler Syntax by Platform

This table is the quick reference: each platform's documented markdown spoiler marker, plus the platforms that have none and what to use there instead.

PlatformSpoiler syntaxScopeHow readers reveal it
Discord||text||InlineClick the dark box
Reddit>!text!<InlineClick the box
Telegram||text|| in Bot API MarkdownV2; Spoiler option in the app's formatting menuInlineTap the blurred text
Stack Exchange>! at the start of a quote lineBlockClick the hidden block
Discourse[spoiler]text[/spoiler]Inline or blockClick the blur
Lemmy::: spoiler Title then :::BlockClick the title
Flarum (Markdown extension)>!text!< or ||text||, plus >! quote linesInline or blockClick the text
MatrixHTML span with data-mx-spoiler, no Markdown markerInlineClient dependent
GitHub, GitLabNone, use <details>BlockClick the summary
Slack, WhatsAppNone in their formatting helpNoneNone
Obsidian (core)None, use a folded calloutBlockClick the callout

A few rows need context. Telegram's Bot API reads the pipes in MarkdownV2, while in the app you select text and pick Spoiler from the formatting menu. On Discord the pipes are one marker among many, and our Discord markdown cheat sheet lists them alongside the rest. For images, files and links, see our guide to marking spoilers on Discord.

Discourse bundles its Spoiler Alert plugin with core and enables it by default, so [spoiler] works unless an admin turns it off. Lemmy renders its container as a collapsible block with your title as the label. Matrix is the odd one out: its spec defines spoilers as HTML, so how you type one depends on your client.

Pipes vs Bang-Brackets: The Two Inline Spoiler Styles

The pipe style wraps the text in two vertical bars on each side. Discord, Flarum and Telegram's MarkdownV2 bot mode read it.

Season 3 ends with ||the station exploding||.

The bang-bracket style opens with >! and closes with !<. Reddit made it popular, and Flarum accepts it too.

Season 3 ends with >!the station exploding!<.

Both render the same way on their home platform: the words sit inside a dark or blurred box until someone clicks. You can usually put bold or italic inside either style. Reddit has its own rules about spacing and paragraphs, which our Reddit formatting guide walks through.

If you write for more than one app, pick the style your main audience reads and convert the rest. No single inline markdown spoiler works everywhere.

Watch for the look-alike on Stack Exchange. There, >! only works at the start of a block quote line, and it hides the whole quoted block:

>! At the end of episode five, it turns out he's his father.

Write >!text!< mid-sentence on Stack Overflow and nothing gets hidden. Write a Stack Exchange-style line on Reddit and nothing gets hidden either, because Reddit needs the closing !<.

How Do You Make Spoiler Text on GitHub?

GitHub has no inline spoiler. The closest you'll get is a collapsed section built from the HTML <details> and <summary> elements, which GitHub's docs describe for hiding content until the reader expands it.

<details>
<summary>Spoiler: how the puzzle is solved</summary>

Rotate the third ring **twice**, then press the center.

</details>

GitHub shows only the summary line with a small arrow. Clicking it reveals the hidden paragraph, and the blank lines around it let the bold text render as Markdown. GitLab supports the same pattern.

This is a collapsed block, not a black bar over a word, so you can't hide half a sentence this way. Use the summary line as your spoiler warning, so readers know what they're about to open. If you want a quick way to build these blocks, the collapsible section generator writes the <details> markup for you in the browser.

Here's the same fallback in our editor. The pipes on the last line stay as plain characters, because the preview uses the marked library for CommonMark plus GFM, which has no spoiler rule:

Spoiler for chapter 12 below.

<details> <summary>Show spoiler</summary>

The butler did it, and the clue was in chapter 3.

</details>

On Discord this would hide: ||the butler did it||

29 words190 characters10 lines
Markdown

Does Obsidian Have Spoiler Text?

Not in core. Obsidian's formatting syntax has no spoiler marker, but a foldable callout comes close. Per Obsidian Help's callouts page, a minus sign after the callout type collapses it by default:

> [!warning]- Spoiler for the finale
> The ship never left orbit.

In Obsidian you see only the title until you click it. Our editor's preview doesn't render callouts, so check this one inside Obsidian.

Community plugins add true spoiler blocks. The Obsidian Spoilers plugin, for example, hides anything in a fenced block tagged spoiler. Remember that the same note opened outside Obsidian shows a plain code block with the secret in full view.

Why Is My Spoiler Showing as Plain Text?

Almost every broken spoiler comes down to one of these causes:

  • Wrong platform syntax. ||text|| means nothing on Reddit, and >!text!< means nothing on Discord. Check the table above.
  • Spoiler inside code. Code spans and code blocks show their content literally, so markers placed inside them stay visible on Discord and most other platforms.
  • Spoiler across a blank line. Reddit spoilers can't span paragraphs, and other apps vary. Wrapping each paragraph in its own pair is the safe choice.
  • The wrong bot parse mode. Telegram's Bot API supports ||spoiler|| in MarkdownV2, while the legacy Markdown mode has no spoiler at all, per the Telegram Bot API docs. Our Telegram markdown guide covers the escaping rules.
  • A renderer with no spoiler support. GitHub, Slack and plain Markdown files will print the markers as typed.

Converting Spoilers When You Cross-Post

Moving a post between apps means swapping markers by hand. Here's the mapping we use:

FromToChange
DiscordReddit||text|| becomes >!text!<
DiscordTelegram bot (MarkdownV2)Keep ||text||
RedditStack ExchangeMove the spoiler onto its own >! quote line
Any chat appGitHub, GitLab, docsWrap the text in a <details> block
AnySlack, WhatsAppAdd a spoiler warning and put the reveal in a reply or link

We prefer <details> for anything that lives in a repo or a docs site. When a renderer doesn't support it, the text shows up readable instead of wrapped in stray pipes or brackets.

One more habit helps: keep the spoiler short. A markdown spoiler around a single name or twist converts cleanly between apps, while a long hidden passage with lists and links rarely survives the trip.

Can You Hide Text with Plain Markdown or HTML?

Partly. HTML has no spoiler element, so you're choosing between three workarounds, each with a catch.

The <details> block above is the only one that lets readers reveal the text on demand. An HTML comment hides text completely, which suits notes to yourself but not spoilers, since nobody can click to see it:

<!-- This line never appears in the rendered page. -->

The third trick is a span styled black on black. It's the weakest option. GitHub's markup pipeline strips inline styles during sanitization, per the github/markup README, and screen readers read the hidden words aloud anyway. That's the real limitation of hiding text in Markdown: outside the apps in the table, a collapsed block is the best you'll get.

A markdown spoiler always depends on where the text ends up. Use the platform's own marker when you know the destination, and fall back to a <details> block when you don't. Build the block, then paste it into the editor to check how the collapsed section and the Markdown inside it render before you post.