]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Allow /etc/ikiwiki/wikilist to list just the names of users, if so then
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 28 Nov 2006 09:10:42 +0000 (09:10 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 28 Nov 2006 09:10:42 +0000 (09:10 +0000)
* Fix url absolution code in inline plugin to support class and id fields in
  links and imgs, and to support anchor urls.

IkiWiki/Plugin/inline.pm
debian/changelog

index eb9708a8c63a2f5ec56894ab5c3f9a05686b32c6..f90d87ae2cebe98273b6a6fa6f20cd6a621c2088 100644 (file)
@@ -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;
 } #}}}
 
index 2e5a6ea15fb6bb8bb281aa3df96ecd35b006a261..5f3b4c323e78f92ca32889362b7603ca4aab2d89 100644 (file)
@@ -1,9 +1,11 @@
 ikiwiki (1.34.2) UNRELEASED; urgency=low
 
-  * Allow /etc/ikiwiki/wikilist to list just the names of users, if so then 
+  * Allow /etc/ikiwiki/wikilist to list just the names of users, if so then
     ~user/.ikiwiki/wikilist will be read.
+  * Fix url absolution code in inline plugin to support class and id fields in
+    links and imgs, and to support anchor urls.
 
- -- Joey Hess <joeyh@debian.org>  Tue, 28 Nov 2006 00:16:40 -0500
+ -- Joey Hess <joeyh@debian.org>  Tue, 28 Nov 2006 04:04:39 -0500
 
 ikiwiki (1.34.1) unstable; urgency=low