Skip to content

Commit 52df1ca

Browse files
committed
pdate README and code to use consistent terminology.
1 parent 395aaa0 commit 52df1ca

5 files changed

Lines changed: 45 additions & 45 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extensions:
102102
* With the flag `MD_FLAG_STRIKETHROUGH`, strike-through spans are enabled
103103
(text enclosed in tilde marks, e.g. `~foo bar~`).
104104

105-
* With the flag `MD_FLAG_SPOILER`, spoiler spans are enabled
105+
* With the flag `MD_FLAG_SPOILERS`, spoiler spans are enabled
106106
(text enclosed in double pipe marks, e.g. `||hidden text||`). (Note that the
107107
HTML renderer outputs them in a custom tag `<x-spoiler>`.)
108108

md2html/md2html.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static const CMDLINE_OPTION cmdline_options[] = {
253253
{ 0, "fpermissive-email-autolinks", '@', 0 },
254254
{ 0, "fpermissive-url-autolinks", 'U', 0 },
255255
{ 0, "fpermissive-www-autolinks", '.', 0 },
256-
{ 0, "fspoiler", 'P', 0 },
256+
{ 0, "fspoilers", 'P', 0 },
257257
{ 0, "fstrikethrough", 'S', 0 },
258258
{ 0, "ftables", 'T', 0 },
259259
{ 0, "ftasklists", 'X', 0 },
@@ -309,7 +309,7 @@ usage(void)
309309
" --fpermissive-email-autolinks\n"
310310
" --fhard-soft-breaks\n"
311311
" Force all soft breaks to act as hard breaks\n"
312-
" --fspoiler Enable spoiler spans (||hidden text||)\n"
312+
" --fspoilers Enable spoiler spans (||hidden text||)\n"
313313
" --fstrikethrough Enable strike-through spans\n"
314314
" --ftables Enable tables\n"
315315
" --ftasklists Enable task lists\n"
@@ -384,7 +384,7 @@ cmdline_callback(int opt, char const* value, void* data)
384384
case '@': parser_flags |= MD_FLAG_PERMISSIVEEMAILAUTOLINKS; break;
385385
case 'V': parser_flags |= MD_FLAG_PERMISSIVEAUTOLINKS; break;
386386
case 'T': parser_flags |= MD_FLAG_TABLES; break;
387-
case 'P': parser_flags |= MD_FLAG_SPOILER; break;
387+
case 'P': parser_flags |= MD_FLAG_SPOILERS; break;
388388
case 'S': parser_flags |= MD_FLAG_STRIKETHROUGH; break;
389389
case 'L': parser_flags |= MD_FLAG_LATEXMATHSPANS; break;
390390
case 'K': parser_flags |= MD_FLAG_WIKILINKS; break;

src/md4c.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,7 +2753,7 @@ md_build_mark_char_map(MD_CTX* ctx)
27532753
ctx->mark_char_map['.'] = 1;
27542754

27552755
if((ctx->parser.flags & MD_FLAG_TABLES) || (ctx->parser.flags & MD_FLAG_WIKILINKS) ||
2756-
(ctx->parser.flags & MD_FLAG_SPOILER))
2756+
(ctx->parser.flags & MD_FLAG_SPOILERS))
27572757
ctx->mark_char_map['|'] = 1;
27582758

27592759
if(ctx->parser.flags & MD_FLAG_COLLAPSEWHITESPACE) {
@@ -3284,7 +3284,7 @@ md_collect_marks(MD_CTX* ctx, const MD_LINE* lines, MD_SIZE n_lines, int table_m
32843284
/* A potential spoiler delimiter: || ... ||
32853285
* Checked before the single-| handler so a double pipe is consumed
32863286
* as one mark and does not become two cell boundaries. */
3287-
if(ch == _T('|') && (ctx->parser.flags & MD_FLAG_SPOILER)) {
3287+
if(ch == _T('|') && (ctx->parser.flags & MD_FLAG_SPOILERS)) {
32883288
if(off + 1 < line->end && CH(off+1) == _T('|')) {
32893289
ADD_MARK(ch, off, off+2, MD_MARK_POTENTIAL_OPENER | MD_MARK_POTENTIAL_CLOSER);
32903290
off += 2;
@@ -4170,7 +4170,7 @@ md_analyze_link_contents(MD_CTX* ctx, const MD_LINE* lines, MD_SIZE n_lines,
41704170
md_analyze_marks(ctx, lines, n_lines, mark_beg, mark_end, _T("&"), 0);
41714171
md_analyze_marks(ctx, lines, n_lines, mark_beg, mark_end, _T("*_~$"), 0);
41724172

4173-
if(ctx->parser.flags & MD_FLAG_SPOILER) {
4173+
if(ctx->parser.flags & MD_FLAG_SPOILERS) {
41744174
for(i = mark_beg; i < mark_end; i++) {
41754175
MD_MARK* mark = &ctx->marks[i];
41764176
if(mark->flags & MD_MARK_RESOLVED)

src/md4c.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ typedef enum MD_SPANTYPE {
149149

150150
/* Spoiler (hidden content revealed on interaction).
151151
* Syntax: ||hidden text||
152-
* Note: Recognized only when MD_FLAG_SPOILER is enabled. */
152+
* Note: Recognized only when MD_FLAG_SPOILERS is enabled. */
153153
MD_SPAN_SPOILER
154154
} MD_SPANTYPE;
155155

@@ -323,7 +323,7 @@ typedef struct MD_SPAN_WIKILINK {
323323
#define MD_FLAG_WIKILINKS 0x2000 /* Enable wiki links extension. */
324324
#define MD_FLAG_UNDERLINE 0x4000 /* Enable underline extension (and disables '_' for normal emphasis). */
325325
#define MD_FLAG_HARD_SOFT_BREAKS 0x8000 /* Force all soft breaks to act as hard breaks. */
326-
#define MD_FLAG_SPOILER 0x10000 /* Enable ||hidden text|| spoiler spans. */
326+
#define MD_FLAG_SPOILERS 0x10000 /* Enable ||hidden text|| spoiler spans. */
327327

328328
#define MD_FLAG_PERMISSIVEAUTOLINKS (MD_FLAG_PERMISSIVEEMAILAUTOLINKS | MD_FLAG_PERMISSIVEURLAUTOLINKS | MD_FLAG_PERMISSIVEWWWAUTOLINKS)
329329
#define MD_FLAG_NOHTML (MD_FLAG_NOHTMLBLOCKS | MD_FLAG_NOHTMLSPANS)
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
55
spans using the `||text||` syntax (popularized by Telegram and Discord).
66

77
A 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

2424
Spoilers 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

3434
Multiple 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

4444
A 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

7979
Strong 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

8989
Inline 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

9999
A 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

109109
Strikethrough 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

119119
A 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

142142
Similarly 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

155155
And 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

179179
A 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
229229
line 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

280280
Nested 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

338338
A 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

363363
Spoiler parsing must not interfere with table cell boundary detection:
@@ -380,13 +380,13 @@ x
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

391391
A 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

401401
Wiki 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

411411
A 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

Comments
 (0)