Skip to content
Spoiler

Spoiler

Posted Updated
By 廿四1 min Read

Hide spoiler contents in your VitePress site.

Setting

.vitepress/config.ts
ts
import { defineConfig } from 'vitepress-theme-niansi'

export default defineConfig({
  markdown: {
    plugins: {
      spoiler: true
    }
  }
})

Syntax

Use !! !! to mark the spoiler content. Note that there should be a space on both sides.

Example

This is spoiler text.

Demo
md
This is !!spoiler!! text.

Changelog

2026-04-18 23:33
View All Changelog