diff options
author | Paul <Paul@web> | 2018-06-09 12:24:48 -0400 |
---|---|---|
committer | admin <admin@branchable.com> | 2018-06-09 12:24:48 -0400 |
commit | b0cfbcabdfcad9803408618a1b999b765ec82eda (patch) | |
tree | 0c49684da1572eec8a8e4f8d37aa14a874b28ef9 /doc/todo | |
parent | adb3b5ea76e466b6873592ee5ec2c09ee28815a4 (diff) | |
download | ikiwiki-b0cfbcabdfcad9803408618a1b999b765ec82eda.tar ikiwiki-b0cfbcabdfcad9803408618a1b999b765ec82eda.tar.gz |
Skip link parsing if a code block identifier is found
Diffstat (limited to 'doc/todo')
-rw-r--r-- | doc/todo/Don__39__t_change_text_like___91____91__this__93____93___in_code_blocks.mdwn | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/todo/Don__39__t_change_text_like___91____91__this__93____93___in_code_blocks.mdwn b/doc/todo/Don__39__t_change_text_like___91____91__this__93____93___in_code_blocks.mdwn new file mode 100644 index 000000000..a022b5552 --- /dev/null +++ b/doc/todo/Don__39__t_change_text_like___91____91__this__93____93___in_code_blocks.mdwn @@ -0,0 +1,33 @@ + diff --git IkiWiki/Plugin/link.pm IkiWiki/Plugin/link.pm + index 1ba28eafd..27427b183 100644 + --- IkiWiki/Plugin/link.pm + +++ IkiWiki/Plugin/link.pm + @@ -107,7 +107,13 @@ sub linkify (@) { + my $page=$params{page}; + my $destpage=$params{destpage}; + + - $params{content} =~ s{(\\?)$link_regexp}{ + + my $content; + + for my $line ( split /\n/, $params{content} ) { + + if ( $line =~ /^(?:\t| )/ ) { + + $content .= $line . "\n"; + + next; + + } + + $line =~ s{(\\?)$link_regexp}{ + defined $2 + ? ( $1 + ? "[[$2|$3".(defined $4 ? "#$4" : "")."]]" + @@ -122,8 +128,10 @@ sub linkify (@) { + : htmllink($page, $destpage, linkpage($3), + anchor => $4)) + }eg; + + $content .= $line . "\n"; + + } + + - return $params{content}; + + return $content; + } + + sub scan (@) { + +Related to [[bugs/wiki links still processed inside code blocks]] and [[forum/How_to_format___91____91__foobar__93____93___in_code_blocks__63__]]. |