[pmwiki-users] (no subject)

Petko Yotov 5ko at 5ko.fr
Fri Jun 3 09:31:49 CDT 2016


1. You don't need to put back the code into the HTML, PmWiki 
automatically does this if your recipe calls the Keep() function. So you 
can remove the last markup rule.

2. I recommend placing your rules not before "<markup", but after the 
escaped code ">[=" this way you can sometimes escape this in order to 
show it in your documentation. So the first rule may start like this:

  Markup_e('keeptagto','>[=',

This will probably also delete existing <:vspace> tags. If it doesn't, 
see below.

3. If the vspace tags are still there, remove them in the KeepTagto() 
function:

   function KeepTagto($html) {
     $html = htmlspecialchars_decode($html);
     $html = preg_replace('/<:[^>]*>/', '', $html);
     # the rest of your function here...

     # your function should probably end like this:
     return Keep($out);
   }


Petko

---
Change log     :  http://www.pmwiki.org/wiki/PmWiki/ChangeLog
Release notes  :  http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes
If you upgrade :  http://www.pmwiki.org/wiki/PmWiki/Upgrades


On 2016-06-03 06:18, Carlos AB wrote:
> Hi,
> 
> I am doing a recipe called tagto, to be able to use html tags inside
> PmWiki in a different way.
> 
> I have one small problem, even though I tried to take the html
> processing entirelly out of the pmwiki flow of markup rules, I still
> get this <:vspace> in the resulting code.
> 
> First there is a rule to Keep - just like the PmWiki function - the
> html out of the code, and the last markup puts the code back and
> translates it to html.
> 
> The rules are as follow:
> 
> Markup_e('keeptagto','<markup','/(\\[tagto\\].*?\\[tagtoend\\])/si',"KeepTagto(\$m[1])");
> 
> Markup_e('rtrvtagto','><:','/(.*)/s',"RtrvTagto(\$m[1])");
> 
> But I still get the <:vspace> tag . How can I get rid of it?
> 
> Carlos_AB
> 



More information about the pmwiki-users mailing list