]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Underscores_in_links_don__39__t_appear.mdwn
unit tests available
[ikiwiki.git] / doc / bugs / Underscores_in_links_don__39__t_appear.mdwn
1 Observed behavior:
2
3 When I create a link like \[[cmd_test]] , the link appears as 'cmd test'.
4
5 Expected behavior:
6
7 I would like to be able to create links with underscores. I realize this is a feature, and I searched for ways to escape the underscore so it would appear, but I didn't find any.
8
9 > as a workaround, you can use \[[cmd\_\_95\_\_test|cmd_test]] (which will link to a page named "cmd test" at the url location "cmd\_test") or \[[cmd\_\_95\_\_test]] (which will link to a page named "cmd\_test" at the url location "cmd\_\_95\_\_test"). i would, from my limited understanding of ikiwiki internals, consider the bug valid, and suggest that
10 >
11 > * explicit link text be not subject to de-escaping (why should it; this would be the short term solution)
12 > * escaped page names never be used in user visible parts of ikiwiki (in my opinion, a user should not need to know about those internals, especially as they are configuration dependant (wiki_file_regexp))
13 >
14 > note that in [[ikiwiki/wikilink]], that very behavior is documented; it says that "\[[foo\_bar|Sandbox]]" will show as "foo bar". (although you can't tell that apart from "foo\_bar" easily because it's a hyperlink).
15 >
16 > i assume that this behavior stems from times when wikilinks and [[ikiwiki/directive]]s were not distinguished by \[[ vs \[[! but by the use of whitespace in directives, so whitespace had to be avoided in wikilinks.
17 >
18 > --[[chrysn]]
19
20 > having hacked around in the [[plugins/link]] plugin, i can confirm that the link texts are explicitly de-escaped, and that when no pipe is inside the link (ie links like `\[[cmd_test]]`), the string `"cmd_test"` is regarded as a link (that will subsequently be converted to a readable text) rather than as a readable text (for which a suitable link target is found automatically). --[[chrysn]]