|
|
@@ -40,17 +40,17 @@ output: [WikilinkOpen(), Text(text="foo"), WikilinkSeparator(), Text(text="bar|b |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
name: nested |
|
|
|
label: a wikilink nested within the value of another |
|
|
|
input: "[[foo|[[bar]]]]" |
|
|
|
output: [WikilinkOpen(), Text(text="foo"), WikilinkSeparator(), WikilinkOpen(), Text(text="bar"), WikilinkClose(), WikilinkClose()] |
|
|
|
name: newline_text |
|
|
|
label: a newline in the middle of the text |
|
|
|
input: "[[foo|foo\nbar]]" |
|
|
|
output: [WikilinkOpen(), Text(text="foo"), WikilinkSeparator(), Text(text="foo\nbar"), WikilinkClose()] |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
name: nested_with_text |
|
|
|
label: a wikilink nested within the value of another, separated by other data |
|
|
|
input: "[[foo|a[[b]]c]]" |
|
|
|
output: [WikilinkOpen(), Text(text="foo"), WikilinkSeparator(), Text(text="a"), WikilinkOpen(), Text(text="b"), WikilinkClose(), Text(text="c"), WikilinkClose()] |
|
|
|
name: bracket_text |
|
|
|
label: a left bracket in the middle of the text |
|
|
|
input: "[[foo|bar[baz]]" |
|
|
|
output: [WikilinkOpen(), Text(text="foo"), WikilinkSeparator(), Text(text="bar[baz"), WikilinkClose()] |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
@@ -96,13 +96,34 @@ output: [Text(text="[[foo"), WikilinkOpen(), Text(text="bar"), WikilinkClose(), |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
name: invalid_nested_text |
|
|
|
name: invalid_nested_padding |
|
|
|
label: invalid wikilink: trying to nest in the wrong context, with a text param |
|
|
|
input: "[[foo[[bar]]|baz]]" |
|
|
|
output: [Text(text="[[foo"), WikilinkOpen(), Text(text="bar"), WikilinkClose(), Text(text="|baz]]")] |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
name: invalid_nested_text |
|
|
|
label: invalid wikilink: a wikilink nested within the value of another |
|
|
|
input: "[[foo|[[bar]]" |
|
|
|
output: [Text(text="[[foo|"), WikilinkOpen(), Text(text="bar"), WikilinkClose()] |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
name: invalid_nested_text_2 |
|
|
|
label: invalid wikilink: a wikilink nested within the value of another, two pairs of closing brackets |
|
|
|
input: "[[foo|[[bar]]]]" |
|
|
|
output: [Text(text="[[foo|"), WikilinkOpen(), Text(text="bar"), WikilinkClose(), Text(text="]]")] |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
name: invalid_nested_text_padding |
|
|
|
label: invalid wikilink: a wikilink nested within the value of another, separated by other data |
|
|
|
input: "[[foo|a[[b]]c]]" |
|
|
|
output: [Text(text="[[foo|a"), WikilinkOpen(), Text(text="b"), WikilinkClose(), Text(text="c]]")] |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
name: incomplete_open_only |
|
|
|
label: incomplete wikilinks: just an open |
|
|
|
input: "[[" |
|
|
|