-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #757 from Golmote/tests-wiki
Add tests for Wiki markup
- Loading branch information
Showing
9 changed files
with
364 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
{| | ||
| Foo | ||
| Bar | ||
|- | ||
| Baz | ||
| Foobar | ||
|} | ||
|
||
{| | ||
|Foo | ||
bar | ||
|
||
baz | ||
| | ||
''Foobar'' | ||
|} | ||
|
||
{| | ||
| Foo || Bar || Baz | ||
|- | ||
| Baz || Bar || Foo | ||
|} | ||
|
||
{| | ||
! style="text-align:left;"| Foo | ||
! Bar | ||
! Baz | ||
|- | ||
| foo | ||
| bar | ||
| baz | ||
|} | ||
|
||
{| | ||
! style="color:red;"| Foo !! style="color:blue;"| Bar !! Baz | ||
|- | ||
| foo || style="font-weight:bold;"| bar || baz | ||
|} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["punctuation", "{|"], | ||
["punctuation", "|"], " Foo\r\n", | ||
["punctuation", "|"], " Bar\r\n", | ||
["punctuation", "|-"], | ||
["punctuation", "|"], " Baz\r\n", | ||
["punctuation", "|"], " Foobar\r\n", | ||
["punctuation", "|}"], | ||
|
||
["punctuation", "{|"], | ||
["punctuation", "|"], "Foo\r\nbar\r\n\r\nbaz\r\n", | ||
["punctuation", "|"], | ||
["emphasis", [["punctuation", "''"], ["italic", "Foobar"], ["punctuation", "''"]]], | ||
["punctuation", "|}"], | ||
|
||
["punctuation", "{|"], | ||
["punctuation", "|"], " Foo ", | ||
["punctuation", "||"], " Bar ", | ||
["punctuation", "||"], " Baz\r\n", | ||
["punctuation", "|-"], | ||
["punctuation", "|"], " Baz ", | ||
["punctuation", "||"], " Bar ", | ||
["punctuation", "||"], " Foo\r\n", | ||
["punctuation", "|}"], | ||
|
||
["punctuation", "{|"], | ||
["punctuation", "!"], | ||
["table-tag", [ | ||
["style-attr", [ | ||
["attr-name", [["attr-name", ["style"]]]], | ||
["punctuation", "=\""], | ||
["attr-value", [ | ||
["property", "text-align"], | ||
["punctuation", ":"], | ||
"left", | ||
["punctuation", ";"] | ||
]], | ||
["punctuation", "\""] | ||
]], | ||
["table-bar", "|"] | ||
]], " Foo\r\n", | ||
["punctuation", "!"], " Bar\r\n", | ||
["punctuation", "!"], " Baz\r\n", | ||
["punctuation", "|-"], | ||
["punctuation", "|"], " foo\r\n", | ||
["punctuation", "|"], " bar\r\n", | ||
["punctuation", "|"], " baz\r\n", | ||
["punctuation", "|}"], | ||
|
||
["punctuation", "{|"], | ||
["punctuation", "!"], | ||
["table-tag", [ | ||
["style-attr", [ | ||
["attr-name", [["attr-name", ["style"]]]], | ||
["punctuation", "=\""], | ||
["attr-value", [ | ||
["property", "color"], | ||
["punctuation", ":"], | ||
"red", | ||
["punctuation", ";"] | ||
]], | ||
["punctuation", "\""] | ||
]], | ||
["table-bar", "|"] | ||
]], " Foo ", | ||
["punctuation", "!!"], | ||
["table-tag", [ | ||
["style-attr", [ | ||
["attr-name", [["attr-name", ["style"]]]], | ||
["punctuation", "=\""], | ||
["attr-value", [ | ||
["property", "color"], | ||
["punctuation", ":"], | ||
"blue", | ||
["punctuation", ";"] | ||
]], | ||
["punctuation", "\""] | ||
]], | ||
["table-bar", "|"] | ||
]], " Bar ", | ||
["punctuation", "!!"], " Baz\r\n", | ||
["punctuation", "|-"], | ||
["punctuation", "|"], " foo ", | ||
["punctuation", "||"], | ||
["table-tag", [ | ||
["style-attr", [ | ||
["attr-name", [["attr-name", ["style"]]]], | ||
["punctuation", "=\""], | ||
["attr-value", [ | ||
["property", "font-weight"], | ||
["punctuation", ":"], | ||
"bold", | ||
["punctuation", ";"] | ||
]], | ||
["punctuation", "\""] | ||
]], | ||
["table-bar", "|"] | ||
]], " bar ", | ||
["punctuation", "||"], " baz\r\n", | ||
["punctuation", "|}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for tables and cell attributes. | ||
Note: Markup is loaded before CSS so that inline styles are added into grammar. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/**/ | ||
/* foo */ | ||
/* foo | ||
bar */ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["block-comment", "/**/"], | ||
["block-comment", "/* foo */"], | ||
["block-comment", "/* foo\r\nbar */"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'''''foo''''' | ||
'''bar''' | ||
''baz'' | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["emphasis", [ | ||
["punctuation", "'''''"], | ||
["bold italic", "foo"], | ||
["punctuation", "'''''"] | ||
]], | ||
["emphasis", [ | ||
["punctuation", "'''"], | ||
["bold", "bar"], | ||
["punctuation", "'''"] | ||
]], | ||
["emphasis", [ | ||
["punctuation", "''"], | ||
["italic", "baz"], | ||
["punctuation", "''"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for bold and italic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
= Header 1 = | ||
== Header 2 == | ||
=== Header 3 === | ||
==== Header 4 ==== | ||
===== Header 5 ===== | ||
====== Header 6 ====== | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["heading", [ | ||
["punctuation", "="], ["important", " Header 1 "], ["punctuation", "="] | ||
]], | ||
["heading", [ | ||
["punctuation", "=="], ["important", " Header 2 "], ["punctuation", "=="] | ||
]], | ||
["heading", [ | ||
["punctuation", "==="], ["important", " Header 3 "], ["punctuation", "==="] | ||
]], | ||
["heading", [ | ||
["punctuation", "===="], ["important", " Header 4 "], ["punctuation", "===="] | ||
]], | ||
["heading", [ | ||
["punctuation", "====="], ["important", " Header 5 "], ["punctuation", "====="] | ||
]], | ||
["heading", [ | ||
["punctuation", "======"], ["important", " Header 6 "], ["punctuation", "======"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for titles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
---- | ||
----- | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["hr", "----"], | ||
["hr", "-----"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for horizontal rows. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<nowiki>{{foo}} ''bar'' <baz></nowiki> | ||
<source>{{foo}} ''bar'' <baz></source> | ||
<pre>{{foo}} ''bar'' <baz></pre> | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["nowiki", [ | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"nowiki" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
"{{foo}} ''bar'' <baz>", | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"nowiki" | ||
]], | ||
["punctuation", ">"] | ||
]] | ||
]], | ||
["nowiki", [ | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"source" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
"{{foo}} ''bar'' <baz>", | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"source" | ||
]], | ||
["punctuation", ">"] | ||
]] | ||
]], | ||
["nowiki", [ | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"pre" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
"{{foo}} ''bar'' <baz>", | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"pre" | ||
]], | ||
["punctuation", ">"] | ||
]] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks that no highlighting is done inside <nowiki>, <pre> and <source> tags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#REDIRECT [[somewhere]] | ||
~~~ | ||
~~~~ | ||
~~~~~ | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["symbol", "#REDIRECT"], ["url", "[[somewhere]]"], | ||
["symbol", "~~~"], | ||
["symbol", "~~~~"], | ||
["symbol", "~~~~~"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for redirects and signatures. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[[w:en:Formal_grammar|Formal grammar]] | ||
[http://www.cl.cam.ac.uk/~mgk25/iso-ebnf.html EBNF help] | ||
|
||
ISBN 1234567890 | ||
ISBN 123456789x | ||
ISBN 1 2 3-4-5 6789 X | ||
ISBN 978-9999999999 | ||
|
||
RFC 822 | ||
PMID 822 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["url", "[[w:en:Formal_grammar|Formal grammar]]"], | ||
["url", "[http://www.cl.cam.ac.uk/~mgk25/iso-ebnf.html EBNF help]"], | ||
|
||
["url", "ISBN 1234567890"], | ||
["url", "ISBN 123456789x"], | ||
["url", "ISBN 1 2 3-4-5 6789 X"], | ||
["url", "ISBN 978-9999999999"], | ||
|
||
["url", "RFC 822"], | ||
["url", "PMID 822"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for links, ISBN, RFC and PMID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
__NOTOC__ | ||
{{{1}}} | ||
{{!}} | ||
{{SITENAME}} | ||
{{#ifexists:foo}} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["variable", "__NOTOC__"], | ||
["variable", "{{{1}}}"], | ||
["variable", "{{!}}"], | ||
["variable", "{{SITENAME}}"], | ||
["variable", "{{#ifexists:foo}}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for variables and magic words. |