Debian Codegraph @

tests/snippets/wikitext/wikilink.txt

raw
1 ---input---
2 [[a|
3 b''b''
4 ]]
5
6 [[维基百科:关于|关于]]
7
8 [[Edge case#]]
9
10 [[Edge case#|another]]
11
12 [[ pagename | https://www.example.com ]]
13
14 [[| this is legal! ]]
15
16 [[ | this is illegal! ]]
17
18 [[public transport#sth]]
19
20 [[:public transport#sth]]
21
22 [[:public transport]]
23
24 [[a:public transport]]
25
26 [[a:public transport#sth]]
27
28 [[a:public transport#sth|<code>a</code> b ''c'' '''d''' ~~~~ <nowiki>[[a]]</nowiki>]]
29
30 London has [[public transport]].
31
32 Link to this page: "[[Help:Wikitext]]" will appear only as bold text.
33
34 New York also has [[public transport|public transportation]].
35
36 [[kingdom (biology)|]]
37
38 [[Seattle, Washington|]]
39
40 [[Wikipedia:Manual of Style#Links|]]
41
42 [[:Category:Character sets|]]
43
44 [[commons:category:Wikimedia]]
45
46 [[Wiktionary:fr:bonjour]]
47
48 [[Wiktionary:fr:bonjour|]]
49
50 [[Wiktionary:fr:bonjour|bonjour]]
51
52 [[ wp:pagename | page name[[ wp:pagename | page name ]] [[ wp:pagename | page name ]] [[ wp:pagename[[ wp:pagename | page name ]] | page name ]] [[ wp:pagename | page nam[[ wp:pagename | page name ]]e ]]]]
53
54 [[ wp:pagename | page name ]]
55
56 [<nowiki />[ wp:pagename | page name ]]
57
58 [[<nowiki /> wp:pagename | page name ]]
59
60 [[ wp:pagename <nowiki />| page name ]]
61
62 [[ wp:pagename | page name ]<nowiki />]
63
64 [[a|]]]]
65
66 [[foo|[https://example.com]]]
67
68 [[a|[[]]]]
69
70 [[Hindenburg disaster|''Hindenburg'' disaster]]
71
72 [[Special:Diff/330349143/330350877|Diff between revisions 330349143 and 330350877]]
73
74 [[Special:Diff/330350877|Diff between revisions 330349143 and 330350877]]
75
76 [[Special:Permalink/330350877|Revision 330350877]]
77
78 [[Special:Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329]]
79
80 [[Special:Contributions/UserName]]
81
82 [[File:wiki.png|thumb|left|alt={{User sandbox notice}}|Wikipedia ''logo'']]
83
84 [[A|[//example.com a b c]]]
85
86 '''[[Special:BlockList/{{BASEPAGENAMEE}}|check]]'''
87
88 ---tokens---
89 '[[' Punctuation
90 'a' Name.Tag
91 '|' Punctuation
92 '\n' Text
93
94 'b' Text
95 "''" Generic.Emph
96 'b' Generic.Emph
97 "''" Generic.Emph
98 '\n' Text
99
100 ']]' Punctuation
101 '\n' Text
102
103 '\n' Text
104
105 '[[' Punctuation
106 '维基百科' Name.Namespace
107 ':' Punctuation
108 '关于' Name.Tag
109 '|' Punctuation
110 '关于' Text
111 ']]' Punctuation
112 '\n' Text
113
114 '\n' Text
115
116 '[[' Punctuation
117 'Edge case' Name.Tag
118 '#' Punctuation
119 ']]' Punctuation
120 '\n' Text
121
122 '\n' Text
123
124 '[[' Punctuation
125 'Edge case' Name.Tag
126 '#' Punctuation
127 '|' Punctuation
128 'another' Text
129 ']]' Punctuation
130 '\n' Text
131
132 '\n' Text
133
134 '[[' Punctuation
135 ' pagename ' Name.Tag
136 '|' Punctuation
137 ' ' Text
138 'https' Text
139 ':' Text
140 '/' Text
141 '/' Text
142 'www' Text
143 '.' Text
144 'example' Text
145 '.' Text
146 'com' Text
147 ' ' Text
148 ']]' Punctuation
149 '\n' Text
150
151 '\n' Text
152
153 '[[' Punctuation
154 '|' Punctuation
155 ' ' Text
156 'this' Text
157 ' ' Text
158 'is' Text
159 ' ' Text
160 'legal' Text
161 '!' Text
162 ' ' Text
163 ']]' Punctuation
164 '\n' Text
165
166 '\n' Text
167
168 '[[' Punctuation
169 ' ' Name.Tag
170 '|' Punctuation
171 ' ' Text
172 'this' Text
173 ' ' Text
174 'is' Text
175 ' ' Text
176 'illegal' Text
177 '!' Text
178 ' ' Text
179 ']]' Punctuation
180 '\n' Text
181
182 '\n' Text
183
184 '[[' Punctuation
185 'public transport' Name.Tag
186 '#' Punctuation
187 'sth' Name.Label
188 ']]' Punctuation
189 '\n' Text
190
191 '\n' Text
192
193 '[[' Punctuation
194 ':' Punctuation
195 'public transport' Name.Tag
196 '#' Punctuation
197 'sth' Name.Label
198 ']]' Punctuation
199 '\n' Text
200
201 '\n' Text
202
203 '[[' Punctuation
204 ':' Punctuation
205 'public transport' Name.Tag
206 ']]' Punctuation
207 '\n' Text
208
209 '\n' Text
210
211 '[[' Punctuation
212 'a' Name.Namespace
213 ':' Punctuation
214 'public transport' Name.Tag
215 ']]' Punctuation
216 '\n' Text
217
218 '\n' Text
219
220 '[[' Punctuation
221 'a' Name.Namespace
222 ':' Punctuation
223 'public transport' Name.Tag
224 '#' Punctuation
225 'sth' Name.Label
226 ']]' Punctuation
227 '\n' Text
228
229 '\n' Text
230
231 '[[' Punctuation
232 'a' Name.Namespace
233 ':' Punctuation
234 'public transport' Name.Tag
235 '#' Punctuation
236 'sth' Name.Label
237 '|' Punctuation
238 '<' Punctuation
239 'code' Name.Tag
240 '>' Punctuation
241 'a' Text
242 '</' Punctuation
243 'code' Name.Tag
244 '>' Punctuation
245 ' ' Text
246 'b' Text
247 ' ' Text
248 "''" Generic.Emph
249 'c' Generic.Emph
250 "''" Generic.Emph
251 ' ' Text
252 "'''" Generic.Strong
253 'd' Generic.Strong
254 "'''" Generic.Strong
255 ' ' Text
256 '~~~~' Keyword
257 ' ' Text
258 '<' Punctuation
259 'nowiki' Name.Tag
260 '>' Punctuation
261 '[' Text
262 '[' Text
263 'a' Text
264 ']' Text
265 ']' Text
266 '</' Punctuation
267 'nowiki' Name.Tag
268 '>' Punctuation
269 ']]' Punctuation
270 '\n' Text
271
272 '\n' Text
273
274 'London' Text
275 ' ' Text
276 'has' Text
277 ' ' Text
278 '[[' Punctuation
279 'public transport' Name.Tag
280 ']]' Punctuation
281 '.' Text
282 '\n' Text
283
284 '\n' Text
285
286 'Link' Text
287 ' ' Text
288 'to' Text
289 ' ' Text
290 'this' Text
291 ' ' Text
292 'page' Text
293 ':' Text
294 ' ' Text
295 '"' Text
296 '[[' Punctuation
297 'Help' Name.Namespace
298 ':' Punctuation
299 'Wikitext' Name.Tag
300 ']]' Punctuation
301 '"' Text
302 ' ' Text
303 'will' Text
304 ' ' Text
305 'appear' Text
306 ' ' Text
307 'only' Text
308 ' ' Text
309 'as' Text
310 ' ' Text
311 'bold' Text
312 ' ' Text
313 'text' Text
314 '.' Text
315 '\n' Text
316
317 '\n' Text
318
319 'New' Text
320 ' ' Text
321 'York' Text
322 ' ' Text
323 'also' Text
324 ' ' Text
325 'has' Text
326 ' ' Text
327 '[[' Punctuation
328 'public transport' Name.Tag
329 '|' Punctuation
330 'public' Text
331 ' ' Text
332 'transportation' Text
333 ']]' Punctuation
334 '.' Text
335 '\n' Text
336
337 '\n' Text
338
339 '[[' Punctuation
340 'kingdom (biology)' Name.Tag
341 '|' Punctuation
342 ']]' Punctuation
343 '\n' Text
344
345 '\n' Text
346
347 '[[' Punctuation
348 'Seattle, Washington' Name.Tag
349 '|' Punctuation
350 ']]' Punctuation
351 '\n' Text
352
353 '\n' Text
354
355 '[[' Punctuation
356 'Wikipedia' Name.Namespace
357 ':' Punctuation
358 'Manual of Style' Name.Tag
359 '#' Punctuation
360 'Links' Name.Label
361 '|' Punctuation
362 ']]' Punctuation
363 '\n' Text
364
365 '\n' Text
366
367 '[[' Punctuation
368 ':Category' Name.Namespace
369 ':' Punctuation
370 'Character sets' Name.Tag
371 '|' Punctuation
372 ']]' Punctuation
373 '\n' Text
374
375 '\n' Text
376
377 '[[' Punctuation
378 'commons:category' Name.Namespace
379 ':' Punctuation
380 'Wikimedia' Name.Tag
381 ']]' Punctuation
382 '\n' Text
383
384 '\n' Text
385
386 '[[' Punctuation
387 'Wiktionary:fr' Name.Namespace
388 ':' Punctuation
389 'bonjour' Name.Tag
390 ']]' Punctuation
391 '\n' Text
392
393 '\n' Text
394
395 '[[' Punctuation
396 'Wiktionary:fr' Name.Namespace
397 ':' Punctuation
398 'bonjour' Name.Tag
399 '|' Punctuation
400 ']]' Punctuation
401 '\n' Text
402
403 '\n' Text
404
405 '[[' Punctuation
406 'Wiktionary:fr' Name.Namespace
407 ':' Punctuation
408 'bonjour' Name.Tag
409 '|' Punctuation
410 'bonjour' Text
411 ']]' Punctuation
412 '\n' Text
413
414 '\n' Text
415
416 '[[' Punctuation
417 ' wp' Name.Namespace
418 ':' Punctuation
419 'pagename ' Name.Tag
420 '|' Punctuation
421 ' ' Text
422 'page' Text
423 ' ' Text
424 'name' Text
425 '' Punctuation
426 '[[' Punctuation
427 ' wp' Name.Namespace
428 ':' Punctuation
429 'pagename ' Name.Tag
430 '|' Punctuation
431 ' ' Text
432 'page' Text
433 ' ' Text
434 'name' Text
435 ' ' Text
436 ']]' Punctuation
437 ' ' Text
438 '[[' Punctuation
439 ' wp' Name.Namespace
440 ':' Punctuation
441 'pagename ' Name.Tag
442 '|' Punctuation
443 ' ' Text
444 'page' Text
445 ' ' Text
446 'name' Text
447 ' ' Text
448 ']]' Punctuation
449 ' ' Text
450 '[' Text
451 '[' Text
452 ' ' Text
453 'wp' Text
454 ':' Text
455 'pagename' Text
456 '[[' Punctuation
457 ' wp' Name.Namespace
458 ':' Punctuation
459 'pagename ' Name.Tag
460 '|' Punctuation
461 ' ' Text
462 'page' Text
463 ' ' Text
464 'name' Text
465 ' ' Text
466 ']]' Punctuation
467 ' ' Text
468 '|' Text
469 ' ' Text
470 'page' Text
471 ' ' Text
472 'name' Text
473 ' ' Text
474 ']' Text
475 ']' Text
476 ' ' Text
477 '[[' Punctuation
478 ' wp' Name.Namespace
479 ':' Punctuation
480 'pagename ' Name.Tag
481 '|' Punctuation
482 ' ' Text
483 'page' Text
484 ' ' Text
485 'nam' Text
486 '' Punctuation
487 '[[' Punctuation
488 ' wp' Name.Namespace
489 ':' Punctuation
490 'pagename ' Name.Tag
491 '|' Punctuation
492 ' ' Text
493 'page' Text
494 ' ' Text
495 'name' Text
496 ' ' Text
497 ']]' Punctuation
498 'e' Text
499 ' ' Text
500 ']' Text
501 ']' Text
502 ']' Text
503 ']' Text
504 '\n' Text
505
506 '\n' Text
507
508 '[[' Punctuation
509 ' wp' Name.Namespace
510 ':' Punctuation
511 'pagename ' Name.Tag
512 '|' Punctuation
513 ' ' Text
514 'page' Text
515 ' ' Text
516 'name' Text
517 ' ' Text
518 ']]' Punctuation
519 '\n' Text
520
521 '\n' Text
522
523 '[' Text
524 '<' Punctuation
525 'nowiki' Name.Tag
526 ' ' Text.Whitespace
527 '/>' Punctuation
528 '[' Text
529 ' ' Text
530 'wp' Text
531 ':' Text
532 'pagename' Text
533 ' ' Text
534 '|' Text
535 ' ' Text
536 'page' Text
537 ' ' Text
538 'name' Text
539 ' ' Text
540 ']' Text
541 ']' Text
542 '\n' Text
543
544 '\n' Text
545
546 '[' Text
547 '[' Text
548 '<' Punctuation
549 'nowiki' Name.Tag
550 ' ' Text.Whitespace
551 '/>' Punctuation
552 ' ' Text
553 'wp' Text
554 ':' Text
555 'pagename' Text
556 ' ' Text
557 '|' Text
558 ' ' Text
559 'page' Text
560 ' ' Text
561 'name' Text
562 ' ' Text
563 ']' Text
564 ']' Text
565 '\n' Text
566
567 '\n' Text
568
569 '[' Text
570 '[' Text
571 ' ' Text
572 'wp' Text
573 ':' Text
574 'pagename' Text
575 ' ' Text
576 '<' Punctuation
577 'nowiki' Name.Tag
578 ' ' Text.Whitespace
579 '/>' Punctuation
580 '|' Text
581 ' ' Text
582 'page' Text
583 ' ' Text
584 'name' Text
585 ' ' Text
586 ']' Text
587 ']' Text
588 '\n' Text
589
590 '\n' Text
591
592 '[[' Punctuation
593 ' wp' Name.Namespace
594 ':' Punctuation
595 'pagename ' Name.Tag
596 '|' Punctuation
597 ' ' Text
598 'page' Text
599 ' ' Text
600 'name' Text
601 ' ' Text
602 ']' Text
603 '<' Punctuation
604 'nowiki' Name.Tag
605 ' ' Text.Whitespace
606 '/>' Punctuation
607 ']' Text
608 '\n' Text
609
610 '\n' Text
611
612 '' Punctuation
613 '[[' Punctuation
614 'a' Name.Tag
615 '|' Punctuation
616 ']]' Punctuation
617 ']' Text
618 ']' Text
619 '\n' Text
620
621 '\n' Text
622
623 '[[' Punctuation
624 'foo' Name.Tag
625 '|' Punctuation
626 '[' Punctuation
627 'https://example.com' Name.Label
628 ']' Punctuation
629 ']]' Punctuation
630 '\n' Text
631
632 '\n' Text
633
634 '[[' Punctuation
635 'a' Name.Tag
636 '|' Punctuation
637 '' Punctuation
638 '[[' Punctuation
639 ']]' Punctuation
640 ']' Text
641 ']' Text
642 '\n' Text
643
644 '\n' Text
645
646 '[[' Punctuation
647 'Hindenburg disaster' Name.Tag
648 '|' Punctuation
649 "''" Generic.Emph
650 'Hindenburg' Generic.Emph
651 "''" Generic.Emph
652 ' ' Text
653 'disaster' Text
654 ']]' Punctuation
655 '\n' Text
656
657 '\n' Text
658
659 '[[' Punctuation
660 'Special' Name.Namespace
661 ':' Punctuation
662 'Diff/330349143/330350877' Name.Tag
663 '|' Punctuation
664 'Diff' Text
665 ' ' Text
666 'between' Text
667 ' ' Text
668 'revisions' Text
669 ' ' Text
670 '330349143' Text
671 ' ' Text
672 'and' Text
673 ' ' Text
674 '330350877' Text
675 ']]' Punctuation
676 '\n' Text
677
678 '\n' Text
679
680 '[[' Punctuation
681 'Special' Name.Namespace
682 ':' Punctuation
683 'Diff/330350877' Name.Tag
684 '|' Punctuation
685 'Diff' Text
686 ' ' Text
687 'between' Text
688 ' ' Text
689 'revisions' Text
690 ' ' Text
691 '330349143' Text
692 ' ' Text
693 'and' Text
694 ' ' Text
695 '330350877' Text
696 ']]' Punctuation
697 '\n' Text
698
699 '\n' Text
700
701 '[[' Punctuation
702 'Special' Name.Namespace
703 ':' Punctuation
704 'Permalink/330350877' Name.Tag
705 '|' Punctuation
706 'Revision' Text
707 ' ' Text
708 '330350877' Text
709 ']]' Punctuation
710 '\n' Text
711
712 '\n' Text
713
714 '[[' Punctuation
715 'Special' Name.Namespace
716 ':' Punctuation
717 'Contributions/2001:0db8:0000:0000:0000:ff00:0042:8329' Name.Tag
718 ']]' Punctuation
719 '\n' Text
720
721 '\n' Text
722
723 '[[' Punctuation
724 'Special' Name.Namespace
725 ':' Punctuation
726 'Contributions/UserName' Name.Tag
727 ']]' Punctuation
728 '\n' Text
729
730 '\n' Text
731
732 '[[' Punctuation
733 'File' Name.Namespace
734 ':' Punctuation
735 'wiki.png' Name.Tag
736 '|' Punctuation
737 'thumb' Text
738 '|' Punctuation
739 'left' Text
740 '|' Punctuation
741 'alt' Name.Attribute
742 '=' Operator
743 '{{' Punctuation
744 'User' Name.Tag
745 ' ' Name.Tag
746 'sandbox' Name.Tag
747 ' ' Name.Tag
748 'notice' Name.Tag
749 '}}' Punctuation
750 '|' Punctuation
751 'Wikipedia' Text
752 ' ' Text
753 "''" Generic.Emph
754 'logo' Generic.Emph
755 "''" Generic.Emph
756 ']]' Punctuation
757 '\n' Text
758
759 '\n' Text
760
761 '[[' Punctuation
762 'A' Name.Tag
763 '|' Punctuation
764 '[' Punctuation
765 '//example.com' Name.Label
766 ' ' Text.Whitespace
767 'a' Text
768 ' ' Text
769 'b' Text
770 ' ' Text
771 'c' Text
772 ']' Punctuation
773 ']]' Punctuation
774 '\n' Text
775
776 '\n' Text
777
778 "'''" Generic.Strong
779 '[[' Punctuation
780 'Special' Name.Namespace
781 ':' Punctuation
782 'BlockList/' Name.Tag
783 '{{' Punctuation
784 'BASEPAGENAMEE' Name.Function
785 '}}' Punctuation
786 '|' Punctuation
787 'check' Text
788 ']]' Punctuation
789 "'''" Generic.Strong
790 '\n' Text