avoid linkifying escaped wikilinks
[ikiwiki.git] / ikiwiki
diff --git a/ikiwiki b/ikiwiki
index 4e64e4031d0d5996f68d072d4bac06e6a3aa4da4..111ef54fce0a5c19d3f1ec68da9f2894269eadaf 100755 (executable)
--- 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;
 } #}}}