[pmwiki-users] How to embed SVG as editable text

Lars Eighner surname at larseighner.com
Wed Aug 16 12:10:43 CDT 2017


This used to work. But php 7 hates it:


Markup('svgtag','fulltext','/\\{\\*(.*?)\\*\\}/esi',"Keep(litsvg('$1'))");

function litsvg($string){
$out = '';
$string = str_replace(array('>', '<', '&'),
   array('>', '<', '&'), $string);
$string = str_replace(array('</p>','<pre>','</pre>',
   "<p class='vspace'>",'\\"'), array('','','','','"'),$string);
$out = $out . $string;
return $out;
}


On Wed, 16 Aug 2017, Petko Yotov wrote:

> You should have, either in local/config.php, or in some cookbook/*.php file a 
> line or a block like this:
>
>  Markup(   or  Markup_e(
>    'svgedit', or something like this
>    '/\\{\\*(.*?)\\*\\}/', or something like this
>   'Keep(PSS("$1"))' or "FmtSVGEdit()" or something like this.
>  );
>
> The third expression is what should tip you, '/\\{\\*(.*?)\\*\\}/', or 
> something like this (it can be written in multiple ways).
>
> If you find such a line, we may be able to rewrite it for PHP 7.
>
> Do you edit actual SVG code directly in the wiki source page, eg
>
>  {*<svg xmlns="..."><path d="m56 56l-52-52"/></svg>*}
>
> ?
>
> Petko
>
>

-- 
Lars Eighner
surname at larseighner.com



More information about the pmwiki-users mailing list