| 1 |
--- |
| 2 |
title: Wikilinks |
| 3 |
based_on: https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/wikilinks_title_before_pipe.md |
| 4 |
--- |
| 5 |
|
| 6 |
# Wikilinks, title before pipe |
| 7 |
|
| 8 |
Wikilinks can have one of the following forms: |
| 9 |
|
| 10 |
[[https://example.org]] |
| 11 |
[[title|https://example.org]] |
| 12 |
[[name of page]] |
| 13 |
[[title|name of page]] |
| 14 |
|
| 15 |
With this version of wikilinks, the title comes before the pipe. |
| 16 |
|
| 17 |
```````````````````````````````` example |
| 18 |
[[https://example.org]] |
| 19 |
. |
| 20 |
<p><a href="https://example.org" data-wikilink="true">https://example.org</a></p> |
| 21 |
```````````````````````````````` |
| 22 |
|
| 23 |
```````````````````````````````` example |
| 24 |
[[title|https://example.org]] |
| 25 |
. |
| 26 |
<p><a href="https://example.org" data-wikilink="true">title</a></p> |
| 27 |
```````````````````````````````` |
| 28 |
|
| 29 |
```````````````````````````````` example |
| 30 |
[[Name of page]] |
| 31 |
. |
| 32 |
<p><a href="Name%20of%20page" data-wikilink="true">Name of page</a></p> |
| 33 |
```````````````````````````````` |
| 34 |
|
| 35 |
```````````````````````````````` example |
| 36 |
[[Title|Name of page]] |
| 37 |
. |
| 38 |
<p><a href="Name%20of%20page" data-wikilink="true">Title</a></p> |
| 39 |
```````````````````````````````` |
| 40 |
|
| 41 |
Regular links should still work! |
| 42 |
|
| 43 |
```````````````````````````````` example |
| 44 |
[Title](Name%20of%20page) |
| 45 |
. |
| 46 |
<p><a href="Name%20of%20page">Title</a></p> |
| 47 |
```````````````````````````````` |
| 48 |
|
| 49 |
HTML entities are recognized both in the name of page and in the link title. |
| 50 |
|
| 51 |
```````````````````````````````` example |
| 52 |
[[Über &nbsp;|Geschütztes Leerzeichen]] |
| 53 |
. |
| 54 |
<p><a href="Gesch%C3%BCtztes%20Leerzeichen" data-wikilink="true">Über &nbsp;</a></p> |
| 55 |
```````````````````````````````` |
| 56 |
|
| 57 |
Escaping characters is supported |
| 58 |
|
| 59 |
```````````````````````````````` example |
| 60 |
[[foo\[\]bar|https://example.org]] |
| 61 |
. |
| 62 |
<p><a href="https://example.org" data-wikilink="true">foo[]bar</a></p> |
| 63 |
```````````````````````````````` |
| 64 |
|
| 65 |
```````````````````````````````` example |
| 66 |
[[Name \[of\] page]] |
| 67 |
. |
| 68 |
<p><a href="Name%20%5Bof%5D%20page" data-wikilink="true">Name [of] page</a></p> |
| 69 |
```````````````````````````````` |
| 70 |
|
| 71 |
Emphasis or other inline markdown is not supported |
| 72 |
|
| 73 |
```````````````````````````````` example |
| 74 |
[[Name _of_ page]] |
| 75 |
. |
| 76 |
<p><a href="Name%20_of_%20page" data-wikilink="true">Name _of_ page</a></p> |
| 77 |
```````````````````````````````` |