Recent Changes - Search:

PITS main list

edit sidebar

Main sidebar



Summary: New core support for svg ignores scripts in svg pictures
Created: 2016-05-30 02:48
Status: Open
Category: Bug
Priority: 3
Version: 2.2.86
OS: Linux/Apache/5.6.7-1

Description: The new way of rendering svg pictures with the <img> tag ignores scripts and css styles that are used inside an svg picture, for instance to add a descriptive text to some parts of the picture or change the way some elements look like.

Removing svgz? and SVGZ? from $ImgExtPattern and relying on the svg cookbook restores the correct behavior (the picture is rendered as an object, and scripts and css are honored).

For an example of such a picture (with the correct rendering as an object, not an img), see:

The svg picture is:

the JavaScript used by this picture is:

the custom css used by the picture is:

This may be a limitation of browsers in rendering svg pictures, however, the svg cookbook provides better support for svg than what is now provided by the core of PmWiki.

Frédéric Boulanger May 30, 2016, at 02:48 AM

You don't need to edit pmwiki.php, simply define $ImgExtPattern in your config.php, then it will be used instead of the one in the core. To which SVG cookbook are you referring? Cookbook:Svg appears to use <embed> and not <object>, however there are snippets on the talk page with <object>. Does the current recipe work? With which browsers and versions does your solution work? --Petko May 30, 2016, at 05:30 AM

Edit - History - Print - Recent Changes - Search
Page last modified on May 30, 2016, at 05:33 AM