1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
|
name: blank
label: wikilink with no content
input: "[[]]"
output: [WikilinkOpen(), WikilinkClose()]
---
name: blank_with_text
label: wikilink with no content but a pipe
input: "[[|]]"
output: [WikilinkOpen(), WikilinkSeparator(), WikilinkClose()]
---
name: basic
label: simplest type of wikilink
input: "[[wikilink]]"
output: [WikilinkOpen(), Text(text="wikilink"), WikilinkClose()]
---
name: with_text
label: wikilink with a text value
input: "[[foo|bar]]"
output: [WikilinkOpen(), Text(text="foo"), WikilinkSeparator(), Text(text="bar"), WikilinkClose()]
---
name: blank_with_multiple_texts
label: no content, multiple pipes
input: "[[|||]]"
output: [WikilinkOpen(), WikilinkSeparator(), Text(text="||"), WikilinkClose()]
---
name: multiple_texts
label: multiple text values separated by pipes
input: "[[foo|bar|baz]]"
output: [WikilinkOpen(), Text(text="foo"), WikilinkSeparator(), Text(text="bar|baz"), 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: 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()]
---
name: nested
label: a wikilink nested within another
input: "[[file:foo|[[bar]]]]"
output: [WikilinkOpen(), Text(text="file:foo"), WikilinkSeparator(), WikilinkOpen(), Text(text="bar"), WikilinkClose(), WikilinkClose()]
---
name: nested_padding
label: a wikilink nested within another, separated by other data
input: "[[file:foo|a[[b]]c]]"
output: [WikilinkOpen(), Text(text="file:foo"), WikilinkSeparator(), Text(text="a"), WikilinkOpen(), Text(text="b"), WikilinkClose(), Text(text="c"), WikilinkClose()]
---
name: invalid_newline
label: invalid wikilink: newline as only content
input: "[[\n]]"
output: [Text(text="[[\n]]")]
---
name: invalid_right_brace
label: invalid wikilink: right brace
input: "[[foo}b}a}r]]"
output: [Text(text="[[foo}b}a}r]]")]
---
name: invalid_left_brace
label: invalid wikilink: left brace
input: "[[foo{{[a}}]]"
output: [Text(text="[[foo{{[a}}]]")]
---
name: invalid_right_bracket
label: invalid wikilink: right bracket
input: "[[foo]bar]]"
output: [Text(text="[[foo]bar]]")]
---
name: invalid_left_bracket
label: invalid wikilink: left bracket
input: "[[foo[bar]]"
output: [Text(text="[[foo[bar]]")]
---
name: invalid_nested_title
label: invalid wikilink: nested within the title of another
input: "[[foo[[bar]]]]"
output: [Text(text="[[foo"), WikilinkOpen(), Text(text="bar"), WikilinkClose(), Text(text="]]")]
---
name: invalid_nested_title_and_text
label: invalid wikilink: nested within the title of another, with a text param
input: "[[foo[[bar]]|baz]]"
output: [Text(text="[[foo"), WikilinkOpen(), Text(text="bar"), WikilinkClose(), Text(text="|baz]]")]
---
name: invalid_nested_no_close
label: invalid wikilink: a wikilink nested within the value of another, missing a pair of closing brackets
input: "[[foo|[[bar]]"
output: [Text(text="[[foo|"), WikilinkOpen(), Text(text="bar"), WikilinkClose()]
---
name: invalid_left_angle_bracket
label: invalid wikilink: left angle bracket
input: "[[foo<bar]]"
output: [Text(text="[[foo<bar]]")]
---
name: invalid_right_angle_bracket
label: invalid wikilink: right angle bracket
input: "[[foo>bar]]"
output: [Text(text="[[foo>bar]]")]
---
name: invalid_newline_at_start
label: invalid wikilink: newline at start of title
input: "[[\nfoobar]]"
output: [Text(text="[[\nfoobar]]")]
---
name: invalid_newline_at_end
label: invalid wikilink: newline at end of title
input: "[[foobar\n]]"
output: [Text(text="[[foobar\n]]")]
---
name: incomplete_open_only
label: incomplete wikilinks: just an open
input: "[["
output: [Text(text="[[")]
---
name: incomplete_open_text
label: incomplete wikilinks: an open with some text
input: "[[foo"
output: [Text(text="[[foo")]
---
name: incomplete_open_text_pipe
label: incomplete wikilinks: an open, text, then a pipe
input: "[[foo|"
output: [Text(text="[[foo|")]
---
name: incomplete_open_pipe
label: incomplete wikilinks: an open, then a pipe
input: "[[|"
output: [Text(text="[[|")]
---
name: incomplete_open_pipe_text
label: incomplete wikilinks: an open, then a pipe, then text
input: "[[|foo"
output: [Text(text="[[|foo")]
---
name: incomplete_open_pipes_text
label: incomplete wikilinks: a pipe, then text then two pipes
input: "[[|f||"
output: [Text(text="[[|f||")]
---
name: incomplete_open_partial_close
label: incomplete wikilinks: an open, then one right brace
input: "[[{}"
output: [Text(text="[[{}")]
---
name: incomplete_preserve_previous
label: incomplete wikilinks: a valid wikilink followed by an invalid one
input: "[[foo]] [[bar"
output: [WikilinkOpen(), Text(text="foo"), WikilinkClose(), Text(text=" [[bar")]
|