From d071b4177c1a3897f4682e245046a45f362b6ac5 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Fri, 1 Oct 2021 14:21:33 +0200 Subject: Squashed 'deps/md4c/' content from commit 7f05330 git-subtree-dir: deps/md4c git-subtree-split: 7f0533068b4319d8cb3d0f33ca9aa66a857734a6 --- test/wiki-links.txt | 232 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 test/wiki-links.txt (limited to 'test/wiki-links.txt') diff --git a/test/wiki-links.txt b/test/wiki-links.txt new file mode 100644 index 0000000..00d394e --- /dev/null +++ b/test/wiki-links.txt @@ -0,0 +1,232 @@ + +# Wiki Links + +With the flag `MD_FLAG_WIKILINKS`, MD4C recognizes wiki links. + +The simple wiki-link is a wiki-link destination enclosed in `[[` followed with +`]]`. + +```````````````````````````````` example +[[foo]] +. +

foo

+```````````````````````````````` + +However wiki-link may contain an explicit label, delimited from the destination +with `|`. + +```````````````````````````````` example +[[foo|bar]] +. +

bar

+```````````````````````````````` + +A wiki-link destination cannot be empty. + +```````````````````````````````` example +[[]] +. +

[[]]

+```````````````````````````````` + +```````````````````````````````` example +[[|foo]] +. +

[[|foo]]

+```````````````````````````````` + + +The wiki-link destination cannot contain a new line. + +```````````````````````````````` example +[[foo +bar]] +. +

[[foo +bar]]

+```````````````````````````````` + +```````````````````````````````` example +[[foo +bar|baz]] +. +

[[foo +bar|baz]]

+```````````````````````````````` + +The wiki-link destination is rendered verbatim; inline markup in it is not +recognized. + +```````````````````````````````` example +[[*foo*]] +. +

*foo*

+```````````````````````````````` + +```````````````````````````````` example +[[foo|![bar](bar.jpg)]] +. +

bar

+```````````````````````````````` + +With multiple `|` delimiters, only the first one is recognized and the other +ones are part of the label. + +```````````````````````````````` example +[[foo|bar|baz]] +. +

bar|baz

+```````````````````````````````` + +However the delimiter `|` can be escaped with `/`. + +```````````````````````````````` example +[[foo\|bar|baz]] +. +

baz

+```````````````````````````````` + +The label can contain inline elements. + +```````````````````````````````` example +[[foo|*bar*]] +. +

bar

+```````````````````````````````` + +Empty explicit label is the same as using the implicit label; i.e. the verbatim +destination string is used as the label. + +```````````````````````````````` example +[[foo|]] +. +

foo

+```````````````````````````````` + +The label can span multiple lines. + +```````````````````````````````` example +[[foo|foo +bar +baz]] +. +

foo +bar +baz

+```````````````````````````````` + +Wiki-links have higher priority than links. + +```````````````````````````````` example +[[foo]](foo.jpg) +. +

foo(foo.jpg)

+```````````````````````````````` + +```````````````````````````````` example +[foo]: /url + +[[foo]] +. +

foo

+```````````````````````````````` + +Wiki links can be inlined in tables. + +```````````````````````````````` example +| A | B | +|------------------|-----| +| [[foo|*bar*]] | baz | +. + + + + + + + + + + + + + +
AB
barbaz
+```````````````````````````````` + +Wiki-links are not prioritized over images. + +```````````````````````````````` example +![[foo]](foo.jpg) +. +

[foo]

+```````````````````````````````` + +Something that may look like a wiki-link at first, but turns out not to be, +is recognized as a normal link. + +```````````````````````````````` example +[[foo] + +[foo]: /url +. +

[foo

+```````````````````````````````` + +Escaping the opening `[` escapes only that one character, not the whole `[[` +opener: + +```````````````````````````````` example +\[[foo]] + +[foo]: /url +. +

[foo]

+```````````````````````````````` + +Like with other inline links, the innermost wiki-link is preferred. + +```````````````````````````````` example +[[foo[[bar]]]] +. +

[[foobar]]

+```````````````````````````````` + +There is limit of 100 characters for the wiki-link destination. + +```````````````````````````````` example +[[12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901]] +[[12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901|foo]] +. +

[[12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901]] +[[12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901|foo]]

+```````````````````````````````` + +100 characters inside a wiki link target works. + +```````````````````````````````` example +[[1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890]] +[[1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890|foo]] +. +

1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +foo

+```````````````````````````````` + +The limit on link content does not include any characters belonging to a block +quote, if the label spans multiple lines contained in a block quote. + +```````````````````````````````` example +> [[12345678901234567890123456789012345678901234567890|1234567890 +> 1234567890 +> 1234567890 +> 1234567890 +> 123456789]] +. +
+

1234567890 +1234567890 +1234567890 +1234567890 +123456789

+
+```````````````````````````````` -- cgit v1.2.3