summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/bugs.mdwn7
-rw-r--r--doc/todo.mdwn6
-rw-r--r--doc/wikilink.mdwn9
-rwxr-xr-xikiwiki6
4 files changed, 13 insertions, 15 deletions
diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn
index 2c712de6d..c9b175453 100644
--- a/doc/bugs.mdwn
+++ b/doc/bugs.mdwn
@@ -20,10 +20,3 @@
replaced with a link to the [[CGI]]?
* [[ikiwiki]] should go to the same place as [[index]] (on this wiki).
* There's no way to escape a [[WikiLink]] when discussing one on a wiki.
-* Wikilinks are even expanded in the middle of [[MarkDown]] code blocks,
- and probably shouldn't be (nor in blockquotes?)
-
- Hmm, the best way to fix this would be to add WikiLink support into
- markdown, but that will probably be a bear. I guess the question is how
- common "[[ ]]" is, and maybe we should just provide a way to escape a
- wikilink..
diff --git a/doc/todo.mdwn b/doc/todo.mdwn
index 23ade8cbd..d65991542 100644
--- a/doc/todo.mdwn
+++ b/doc/todo.mdwn
@@ -56,16 +56,16 @@ Make the html valid. Add css.
## sigs
-Need a way to sign name in page that's easier to type than "-- [[ Joey ]]"
+Need a way to sign name in page that's easier to type than "--\[[Joey]]"
and that includes the date.
-What syntax do other wikis use for this? I'm considering "[[ -- ]]" (with
+What syntax do other wikis use for this? I'm considering "\[[--]]" (with
spaces removed) as it has a nice nmemonic.
OTOH, adding additional syntax for this would be counter to one of the
design goals for ikiwiki: keeping as much markup as possible out of the
wiki and not adding nonstandard markup. And it's not significantly hard to
-type "--[[Joey]]", and as to the date, we do have page history.
+type "--\[[Joey]]", and as to the date, we do have page history.
## recentchanges links to commit diffs
diff --git a/doc/wikilink.mdwn b/doc/wikilink.mdwn
index 03cb2b3c3..dab5d3ac4 100644
--- a/doc/wikilink.mdwn
+++ b/doc/wikilink.mdwn
@@ -1,6 +1,9 @@
WikiLinks provide easy linking between pages of the wiki. To create a
-WikiLink, just put the name of the page to link to in double brackets. For
-examples "[[ WikiLink ]]" (without the added whitespace).
+[[WikiLink]], just put the name of the page to link to in double brackets.
+For example "\[[WikiLink]]".
+
+If you ever need to write something like "\[[WikiLink]] without creating a
+wikilink, just prefix it with a "\", like "\\\\[[WikiLink]]".
Note that there are some special [[SubPage/LinkingRules]] that come into
play when linking between [[SubPage]]s.
@@ -8,4 +11,4 @@ play when linking between [[SubPage]]s.
WikiLinks can be entered in any case you like, the page they link to is
always lowercased.
-Note that if the file linked to by a WikiLink looks like an image, it will be displayed inline on the page. \ No newline at end of file
+Note that if the file linked to by a WikiLink looks like an image, it will be displayed inline on the page.
diff --git a/ikiwiki b/ikiwiki
index 4e64e4031..111ef54fc 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -172,7 +172,7 @@ sub findlinks ($) { #{{{
my $content=shift;
my @links;
- while ($content =~ /$config{wiki_link_regexp}/g) {
+ while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
push @links, lc($1);
}
return @links;
@@ -247,7 +247,9 @@ sub linkify ($$) { #{{{
my $content=shift;
my $file=shift;
- $content =~ s/$config{wiki_link_regexp}/htmllink(pagename($file), $1)/eg;
+ $content =~ s{(\\?)$config{wiki_link_regexp}}{
+ $1 ? "[[$2]]" : htmllink(pagename($file), $2)
+ }eg;
return $content;
} #}}}