Support svg as a inlinable image type
authorJoey Hess <joey@kitenet.net>
Wed, 29 Jun 2011 18:17:12 +0000 (14:17 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 29 Jun 2011 18:17:47 +0000 (14:17 -0400)
svg images can be included on a page by simply linking to them, or by using
the img directive. Note that sanitizing svg files is still not addressed.

IkiWiki.pm
debian/changelog
doc/bugs/SVG_files_not_recognized_as_images.mdwn

index 7662263383271fd31e988e33cf68d00a8d2ed4ce..7035cb034d96bdf3f2a92a8655e94e2b597bf39e 100644 (file)
@@ -1026,7 +1026,7 @@ sub bestlink ($$) {
 sub isinlinableimage ($) {
        my $file=shift;
        
-       return $file =~ /\.(png|gif|jpg|jpeg)$/i;
+       return $file =~ /\.(png|gif|jpg|jpeg|svg)$/i;
 }
 
 sub pagetitle ($;$) {
index 8191a212a4ffc8cadcebea737256e0a8ccbf406d..cf17d213c1501bfae3042745ca839759789ae270 100644 (file)
@@ -15,6 +15,9 @@ ikiwiki (3.20110609) UNRELEASED; urgency=low
   * Add libtext-multimarkdown-perl to Suggests. Closes: #630705
   * headinganchors: Plugin by Paul Wise that adds ids to <hn> headings.
   * html5 is not experimental anymore. But not the default either, quite yet.
+  * Support svg as a inlinable image type; svg images can be included on a
+    page by simply linking to them, or by using the img directive.
+    Note that sanitizing svg files is still not addressed.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 09 Jun 2011 10:06:44 -0400
 
index 207edd4266fad38aca9aae9c74b3614734f93777..b14cd9b9453087794ef378cc9624406802b2ffcf 100644 (file)
@@ -17,6 +17,16 @@ The 'img' plugin also seems to not support SVGs.
 > image (png). The img plugin could probably do that fairly simply.
 > --[[Joey]]
 
+>> This seems to have improved since; at least chromium can display svg
+>> images from `<img>` tags. Firefox 3.5.19 did not in my testing.
+>>
+>> So, svgs can now be included on pages by linking to them, or by using
+>> the img directive. The most portable thing is to use the img directive
+>> plus some size, which forces them to be resized and a png to actually
+>> be displayed.
+>>
+>> I have not yet tried to do anything with sanitizing them. --[[Joey]] 
+
 >> I'm working on inline SVG and MathML support in ikiwiki and I've
 >> modified my htmlscrubber to sanitize SVG and MathML using the
 >> whitelists from html5lib.  Here's a [patch][].  I've also made some