diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-28 09:10:42 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-28 09:10:42 +0000 |
commit | abd262cf58315ddcd8bc3d3d835d6eb1e107651e (patch) | |
tree | 8709f05fa1309436e2bcee5bf65969355be09de4 /IkiWiki/Plugin | |
parent | c861b8cae9f0b2a74b9f7b6f4344d1c9ed18496c (diff) | |
download | ikiwiki-abd262cf58315ddcd8bc3d3d835d6eb1e107651e.tar ikiwiki-abd262cf58315ddcd8bc3d3d835d6eb1e107651e.tar.gz |
* Allow /etc/ikiwiki/wikilist to list just the names of users, if so then
* Fix url absolution code in inline plugin to support class and id fields in
links and imgs, and to support anchor urls.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index eb9708a8c..f90d87ae2 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -234,12 +234,14 @@ sub date_3339 ($) { #{{{ sub absolute_urls ($$) { #{{{ # sucky sub because rss sucks my $content=shift; - my $url=shift; + my $baseurl=shift; + my $url=$baseurl; $url=~s/[^\/]+$//; - $content=~s/<a\s+href="(?![^:]+:\/\/)([^"]+)"/<a href="$url$1"/ig; - $content=~s/<img\s+src="(?![^:]+:\/\/)([^"]+)"/<img src="$url$1"/ig; + $content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(#[^"]+)"/$1 href="$baseurl$2"/ig; + $content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(?![^:]+:\/\/)([^"]+)"/$1 href="$url$2"/ig; + $content=~s/(<img(?:\s+(?:class|id)="?\w+"?)?)\s+src="(?![^:]+:\/\/)([^"]+)"/$1 src="$url$2"/ig; return $content; } #}}} |