]> sipb.mit.edu Git - ikiwiki.git/commitdiff
fix for already relative urls
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 23 Mar 2006 21:21:31 +0000 (21:21 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 23 Mar 2006 21:21:31 +0000 (21:21 +0000)
IkiWiki/Render.pm

index 1c56677ba162ed87f7da802a17612959a126878a..1ac85be44dad722e1588000fde059d420a433659 100644 (file)
@@ -139,12 +139,8 @@ sub absolute_urls ($$) { #{{{
 
        $url=~s/[^\/]+$//;
        
-       $content=~s{<a\s+href="([^"]+)"}{
-               "<a href=\"$url$1\""
-       }ieg;
-       $content=~s{<img\s+src="([^"]+)"}{
-               "<img src=\"$url$1\""
-       }ieg;
+       $content=~s/<a\s+href="(?!http:\/\/)([^"]+)"/<a href="$url$1"/ig;
+       $content=~s/<img\s+src="(?!http:\/\/)([^"]+)"/<img src="$url$1"/ig;
        return $content;
 } #}}}