1 diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm
2 index 1ba28eafd..61a397bf8 100644
3 --- a/IkiWiki/Plugin/link.pm
4 +++ b/IkiWiki/Plugin/link.pm
5 @@ -107,7 +107,13 @@ sub linkify (@) {
6 my $page=$params{page};
7 my $destpage=$params{destpage};
9 - $params{content} =~ s{(\\?)$link_regexp}{
11 + for my $line ( split /\n/, $params{content} ) {
12 + if ( $line =~ /^(?:\t| )/ ) {
13 + $content .= $line . "\n";
16 + $line =~ s{(\\?)$link_regexp}{
19 ? "[[$2|$3".(defined $4 ? "#$4" : "")."]]"
20 @@ -122,8 +128,10 @@ sub linkify (@) {
21 : htmllink($page, $destpage, linkpage($3),
24 + $content .= $line . "\n";
27 - return $params{content};
33 Related to [[bugs/wiki links still processed inside code blocks]] and [[forum/How_to_format___91____91__foobar__93____93___in_code_blocks__63__]].
37 > It looks as though this patch would break linkification in any syntactic construct that
38 > uses indentation but isn't a code block, for instance a list:
42 > * And \[[this is a link|http://example.com]]
48 > * And [[this is a link|http://example.com]]
50 > It's also assuming that Markdown is the only language available (trying to use Markdown
51 > rules), and even in Markdown it doesn't support Github-style fenced code blocks if enabled.
53 > This is not something that can be done correctly by just patching the link plugin.
54 > I'm not sure whether it's something that can be done correctly at all, unfortunately.
56 > [[!tag reviewed]] --[[smcv]]