HB 剧透标签短代码

剧透标签可以让你写下一些用户可能不想看到的文字,并将其隐藏起来,直到读者选择查看。

语法

自闭合语法

1{{< spoiler-tag />}}

闭合语法

1{{< spoiler-tag >}}
2TEXT
3{{< /spoiler-tag >}}

参数

text

索引名称类型必填默认值版本示例
#0textstring---

当使用自闭合语法时必填。

markdown

索引名称类型必填默认值版本示例
#1markdownboolean-false--

true 时,将其视作 Markdown 文本进行渲染。

selectable

索引名称类型必填默认值版本示例
-selectableboolean-false--

标签文本是否可选择。

示例

内联剧透标签示例

源码
1In the movie, {{< spoiler-tag "the hero kills his wife." />}}
结果
In the movie, the hero kills his wife.

可选择的剧透标签示例

源码
1In the example, {{< spoiler-tag text="the spoiler tag is selectable." selectable=true />}}
结果
In the example, the spoiler tag is selectable.

带有 Markdown 格式的长剧透标签示例

源码
1Lorem ipsum dolor sit amet, consectetur adipiscing elit.
2{{< spoiler-tag markdown=true >}}
3__Aenean__ _quis_ ipsum ~~tortor~~. Integer vel lectus vel mauris mattis laoreet. In quis pellentesque metus. Fusce tincidunt purus a leo feugiat, id vehicula nunc congue. Fusce posuere sodales sagittis. Maecenas scelerisque est vel scelerisque sollicitudin. Nam id ligula placerat dolor interdum ullamcorper. Proin a venenatis purus. Donec accumsan et risus sit amet rhoncus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce eu semper urna. Suspendisse ex lacus, malesuada ut nisi in, hendrerit imperdiet enim. In erat ex, tincidunt eget hendrerit eu, efficitur a neque. Vestibulum purus dolor, lobortis vel varius ac, elementum vel dolor.
4{{< /spoiler-tag >}}
结果
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quis ipsum tortor. Integer vel lectus vel mauris mattis laoreet. In quis pellentesque metus. Fusce tincidunt purus a leo feugiat, id vehicula nunc congue. Fusce posuere sodales sagittis. Maecenas scelerisque est vel scelerisque sollicitudin. Nam id ligula placerat dolor interdum ullamcorper. Proin a venenatis purus. Donec accumsan et risus sit amet rhoncus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce eu semper urna. Suspendisse ex lacus, malesuada ut nisi in, hendrerit imperdiet enim. In erat ex, tincidunt eget hendrerit eu, efficitur a neque. Vestibulum purus dolor, lobortis vel varius ac, elementum vel dolor.
razonyang
2024年12月4日星期三 2024年2月18日星期日