[pmwiki-devel] Customise uploaded files markup for SVG

Petko Yotov 5ko at 5ko.fr
Sat Jun 27 04:59:05 CDT 2009


On Tuesday 23 June 2009 21:02:48 Jan Bernitt wrote:
> I did my thesis using the PmWiki. As part of the software I developed an
> export of SVG-files. I added an custom markup to include SVGs as objects
> shown like images by most browsers. But therefore they have to exist in
> a fix directory. Now I think its easier to use the upload function. I
> allowed the .svg file extension for uploads. But I can't find the lines
> to change so that svg-files will use custom rendering like images. Where
> do I have to look ?

If you want PmWiki to include an SVG file with the <img src="pic.svg"/> HTML 
tag, place this in config.php :

  $ImgExtPattern="\\.(?:gif|jpg|jpeg|png|svg|GIF|JPG|JPEG|PNG|SVG)";

As of today, however, only Opera and Safari seem to support such embedding.

To allow uploading of .svg files, add also to config.php :
  $UploadExts['svg'] = "image/svg+xml";

If you have to use an <iframe> of an <object>, this recipe could be helpful:
  http://www.pmwiki.org/wiki/Cookbook/LinkedResourceExtras

Thanks,
Petko



More information about the pmwiki-devel mailing list