11
22# Spoiler Spans
33
4- With the flag `MD_FLAG_SPOILER `, MD4C enables recognition of inline spoiler
4+ With the flag `MD_FLAG_SPOILERS `, MD4C enables recognition of inline spoiler
55spans using the `||text||` syntax (popularized by Telegram and Discord).
66
77A spoiler span is content wrapped in exactly two consecutive pipe characters
@@ -18,7 +18,7 @@ content in `<x-spoiler>` tags.
1818.
1919<p><x-spoiler>Hello, world!</x-spoiler></p>
2020.
21- --fspoiler
21+ --fspoilers
2222````````````````````````````````
2323
2424Spoilers may appear inline alongside normal text:
@@ -28,7 +28,7 @@ This is normal text with ||hidden content|| revealed here.
2828.
2929<p>This is normal text with <x-spoiler>hidden content</x-spoiler> revealed here.</p>
3030.
31- --fspoiler
31+ --fspoilers
3232````````````````````````````````
3333
3434Multiple independent spoiler spans in the same paragraph:
@@ -38,7 +38,7 @@ Multiple independent spoiler spans in the same paragraph:
3838.
3939<p><x-spoiler>first</x-spoiler> and <x-spoiler>second</x-spoiler></p>
4040.
41- --fspoiler
41+ --fspoilers
4242````````````````````````````````
4343
4444A spoiler span at the very start and end of a paragraph:
@@ -48,13 +48,13 @@ A spoiler span at the very start and end of a paragraph:
4848.
4949<p><x-spoiler>entire paragraph is a spoiler</x-spoiler></p>
5050.
51- --fspoiler
51+ --fspoilers
5252````````````````````````````````
5353
5454
5555## Flag required
5656
57- Without `MD_FLAG_SPOILER ` the `||` sequence is treated as literal text:
57+ Without `MD_FLAG_SPOILERS ` the `||` sequence is treated as literal text:
5858
5959```````````````````````````````` example
6060||hidden||
@@ -73,7 +73,7 @@ Emphasis inside a spoiler:
7373.
7474<p><x-spoiler>nested <em>emphasis</em></x-spoiler></p>
7575.
76- --fspoiler
76+ --fspoilers
7777````````````````````````````````
7878
7979Strong emphasis inside a spoiler:
@@ -83,7 +83,7 @@ Strong emphasis inside a spoiler:
8383.
8484<p><x-spoiler><strong>bold</strong> and <em>italic</em> together</x-spoiler></p>
8585.
86- --fspoiler
86+ --fspoilers
8787````````````````````````````````
8888
8989Inline code inside a spoiler:
@@ -93,7 +93,7 @@ Inline code inside a spoiler:
9393.
9494<p><x-spoiler>spoiler with <code>code</code></x-spoiler></p>
9595.
96- --fspoiler
96+ --fspoilers
9797````````````````````````````````
9898
9999A link inside a spoiler:
@@ -103,7 +103,7 @@ A link inside a spoiler:
103103.
104104<p><x-spoiler>spoiler with <a href="http://example.com">a link</a></x-spoiler></p>
105105.
106- --fspoiler
106+ --fspoilers
107107````````````````````````````````
108108
109109Strikethrough inside a spoiler (requires both flags):
@@ -113,7 +113,7 @@ Strikethrough inside a spoiler (requires both flags):
113113.
114114<p><x-spoiler><del>strikethrough inside spoiler</del></x-spoiler></p>
115115.
116- --fspoiler --fstrikethrough
116+ --fspoilers --fstrikethrough
117117````````````````````````````````
118118
119119A spoiler inside strikethrough:
@@ -123,7 +123,7 @@ A spoiler inside strikethrough:
123123.
124124<p><del>del with <x-spoiler>spoiler</x-spoiler> inside</del></p>
125125.
126- --fspoiler --fstrikethrough
126+ --fspoilers --fstrikethrough
127127````````````````````````````````
128128
129129
@@ -136,7 +136,7 @@ Pipe characters inside a code span are not recognized as spoiler delimiters:
136136.
137137<p><code>code with ||pipes||</code></p>
138138.
139- --fspoiler
139+ --fspoilers
140140````````````````````````````````
141141
142142Similarly inside a fenced code block:
@@ -149,7 +149,7 @@ Similarly inside a fenced code block:
149149<pre><code>||not a spoiler||
150150</code></pre>
151151.
152- --fspoiler
152+ --fspoilers
153153````````````````````````````````
154154
155155And inside an indented code block:
@@ -160,7 +160,7 @@ And inside an indented code block:
160160<pre><code>||not a spoiler||
161161</code></pre>
162162.
163- --fspoiler
163+ --fspoilers
164164````````````````````````````````
165165
166166
@@ -173,7 +173,7 @@ A lone `||` with no matching closer is left as literal text:
173173.
174174<p>||unclosed spoiler</p>
175175.
176- --fspoiler
176+ --fspoilers
177177````````````````````````````````
178178
179179A lone closer with no preceding opener is also left as literal text:
@@ -183,7 +183,7 @@ unclosed spoiler||
183183.
184184<p>unclosed spoiler||</p>
185185.
186- --fspoiler
186+ --fspoilers
187187````````````````````````````````
188188
189189
@@ -197,7 +197,7 @@ preventing spoiler recognition:
197197.
198198<p>||not a spoiler||</p>
199199.
200- --fspoiler
200+ --fspoilers
201201````````````````````````````````
202202
203203
@@ -213,7 +213,7 @@ ends here||
213213<p>||starts here</p>
214214<p>ends here||</p>
215215.
216- --fspoiler
216+ --fspoilers
217217````````````````````````````````
218218
219219
@@ -228,7 +228,7 @@ line spoiler||
228228<p><x-spoiler>multi
229229line spoiler</x-spoiler></p>
230230.
231- --fspoiler
231+ --fspoilers
232232````````````````````````````````
233233
234234
@@ -241,7 +241,7 @@ Two consecutive `||` pairs produce an empty spoiler span:
241241.
242242<p><x-spoiler></x-spoiler></p>
243243.
244- --fspoiler
244+ --fspoilers
245245````````````````````````````````
246246
247247
@@ -254,15 +254,15 @@ Two consecutive `||` pairs produce an empty spoiler span:
254254.
255255<h1><x-spoiler>heading spoiler</x-spoiler></h1>
256256.
257- --fspoiler
257+ --fspoilers
258258````````````````````````````````
259259
260260```````````````````````````````` example
261261## ||level two||
262262.
263263<h2><x-spoiler>level two</x-spoiler></h2>
264264.
265- --fspoiler
265+ --fspoilers
266266````````````````````````````````
267267
268268### Block quotes
@@ -274,7 +274,7 @@ Two consecutive `||` pairs produce an empty spoiler span:
274274<p><x-spoiler>hidden in a quote</x-spoiler></p>
275275</blockquote>
276276.
277- --fspoiler
277+ --fspoilers
278278````````````````````````````````
279279
280280Nested block quotes:
@@ -288,7 +288,7 @@ Nested block quotes:
288288</blockquote>
289289</blockquote>
290290.
291- --fspoiler
291+ --fspoilers
292292````````````````````````````````
293293
294294### Unordered lists
@@ -302,7 +302,7 @@ Nested block quotes:
302302<li>normal item</li>
303303</ul>
304304.
305- --fspoiler
305+ --fspoilers
306306````````````````````````````````
307307
308308### Ordered lists
@@ -316,10 +316,10 @@ Nested block quotes:
316316<li>normal item</li>
317317</ol>
318318.
319- --fspoiler
319+ --fspoilers
320320````````````````````````````````
321321
322- ### Task lists (requires MD_FLAG_TASKLISTS)
322+ ### Task lists (requires ` MD_FLAG_TASKLISTS` )
323323
324324```````````````````````````````` example
325325- [ ] ||task item spoiler||
@@ -330,10 +330,10 @@ Nested block quotes:
330330<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled checked>done</li>
331331</ul>
332332.
333- --fspoiler --ftasklists
333+ --fspoilers --ftasklists
334334````````````````````````````````
335335
336- ### Tables (requires MD_FLAG_TABLES)
336+ ### Tables (requires ` MD_FLAG_TABLES` )
337337
338338A spoiler inside a table cell:
339339
@@ -357,7 +357,7 @@ A spoiler inside a table cell:
357357</tbody>
358358</table>
359359.
360- --fspoiler --ftables
360+ --fspoilers --ftables
361361````````````````````````````````
362362
363363Spoiler parsing must not interfere with table cell boundary detection:
380380</tbody>
381381</table>
382382.
383- --fspoiler --github
383+ --fspoilers --github
384384````````````````````````````````
385385
386386
387387## Interaction with other extensions
388388
389- ### Wiki links (requires MD_FLAG_WIKILINKS)
389+ ### Wiki links (requires ` MD_FLAG_WIKILINKS` )
390390
391391A spoiler inside the display portion of a wiki link:
392392
@@ -395,7 +395,7 @@ A spoiler inside the display portion of a wiki link:
395395.
396396<p><x-wikilink data-target="target">display with <x-spoiler>spoiler</x-spoiler></x-wikilink></p>
397397.
398- --fspoiler --fwiki-links
398+ --fspoilers --fwiki-links
399399````````````````````````````````
400400
401401Wiki links with a `|` separator must not be mistaken for spoiler delimiters:
@@ -405,7 +405,7 @@ Wiki links with a `|` separator must not be mistaken for spoiler delimiters:
405405.
406406<p><x-wikilink data-target="foo">bar</x-wikilink></p>
407407.
408- --fspoiler --fwiki-links
408+ --fspoilers --fwiki-links
409409````````````````````````````````
410410
411411A wiki link whose label contains an unrelated `|` character:
@@ -415,5 +415,5 @@ A wiki link whose label contains an unrelated `|` character:
415415.
416416<p><x-wikilink data-target="foo">bar|baz</x-wikilink></p>
417417.
418- --fspoiler --fwiki-links
418+ --fspoilers --fwiki-links
419419````````````````````````````````
0 commit comments