APE Resolution Request
We use APE on our site but I also want to be able to use SVG. Has the conflict been resolved?
Ape has the vocation to make it easy to embed various pieces of media, I only need to find the time to add stuff other than external providers. Would you like to download a pre-release, test in various situations it and report if it works?
To enable SVG embed with the new version, disable svg.php, and add to config.php this line:
# Disable SVG handling by the core (since PmWiki 2.2.85) $ImgExtPattern="\\.(?:gif|jpg|jpeg|png|GIF|JPG|JPEG|PNG)";
Svg recipe and SiteAnalyzer
$RecipeInfo['SVG']['Version'] = '20150919';
$RecipeInfo['Svg']['Version'] = '20150919';
seems to fix the problem.
I hope that this small fix doesn't introduce any other problem.
Thanks, fixed. --Petko October 20, 2016, at 11:18 PM
Still my server is in PHP5.6.8, the message of my wiki is "Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in....". Is there an issue with a new svg.php or a new version of PMwiki?
I've updated the recipe and it should work now. You need PmWiki 2.2.58 or newer (latest recommended). --Petko September 19, 2015, at 08:13 AM
I am using the form %width=700 height=300% Attach:test.svg In the displayed page, I get a link, which does display the svg when clicked on. Is this correct behavior? From reading the docs it seems like svg's may be embedded in other pages. pb 9/28/2016 pmwiki 2.2.72
Bug Report -- Duplicate Variable Name
To address this error, SwfTagFmt must be replaced in the recipe in two places. I suggest using SvgTagFmt or something else the should be relatively unique. This error will cause all the recipes that use this SwfTagFmt variable name to get the mime specific replacement from whichever recipe was loaded last.
Reported by -Kurt Devlin February 16, 2006, at 03:57 PM
Fix proposal with support for alternate content
<?php if (!defined('PmWiki')) exit(); /* Copyright (C) 2004 Patrick R. Michaud <firstname.lastname@example.org> Copyright (C) 2006 Christoph Sommer <http://www.deltadevelopment.de/users/christoph/> This file is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This module enables embedding of Scaleable Vector Grafics (.svg) files into wiki pages. To use this module, simply place this file in the cookbook/ directory and add the following line into config.php: include_once('cookbook/svg.php'); You can then embed SVG files into a wiki file by adding lines following these examples: %width=700 height=300% http://www.example.com/dir/test.svg %width=700 height=300% Attach:test.svg %width=700 height=300% Attach:test.svg"Alternate Content" %width=700 height=300% Attach:test.svg"Attach:test.gif" */ // Public recipe information $RecipeInfo['Svg']['Version'] = '2006-11-22'; // Allow uploading of files ending in .svg or .svgz $UploadExts['svg'] = 'image/svg+xml'; $UploadExts['svgz'] = 'image/svg+xml'; // Define replacements for SVG ressources Markup('svg', '<urllink', "/\\b(?>(\\L))([^\\s$UrlExcludeChars]+\\.svg)(\"([^\"]*)\")?/e", "Keep(\$GLOBALS['LinkFunctions']['$1'](\$pagename,'$1','$2',NULL,'$1$2', '<object type=\'image/svg+xml\' data=\'\$LinkUrl\'>'), 'L').'$4'.Keep('</object>')"); ?>
%width=700 height=300% http://server/dir/test.svg %width=700 height=300% Attach:test.svg
The Adove SVG Viewer 3.03 IE problem can be fixed by replacing the last script line with:
'<object type=\'image/svg+xml\' data=\'\$LinkUrl\'> <param name=\'src\' value=\'\$LinkUrl\'>'), 'L').'$4'.Keep('</object>')");
(added by Lorenz)
To properly handle SVGZ files, the markup declaration must be changed to the following:
Markup('svg', '<urllink', "/\\b(?>(\\L))([^\\s$UrlExcludeChars]+\\.svgz?)(\"([^\"]*)\")?/e", ...