[pmwiki-users] (no subject)

Carlos AB cabsec.pmwiki at gmail.com
Fri Jun 3 11:33:20 CDT 2016


I forgot the subject, sorry for that.

I use my own version of Keep, just like you proposed, it is sligtly
different from the one on PmWiki, I don't use html tags with "<" and
">" I use a markup similar to bbcode and I take the tatgto markup out
of the flow very early so it can be interpreted just as pure HTML no
influence whatsoever with any of the PmWiki rules.

Actually tagto is just an array wih rules for translation of tagto to
html, those rules do not mix with pmwiki rules, and are kept aside.

I did just that, remove the "<:*>" inside the tagto block of tags,
that was kept very early, but I tought it could be done in another way
so I asked.

I know I have to take some steps to sanitize the output, filter many
risky html attributes, but all spaces will be preserved and the html
will be outputed just the way it was written in tagto.

I want to use this to further incorporate different visual editors to
PmWiki, both in mixed mode (Pmwiki markup togheter with html) and just
pure html (everything gets translated to html).

Carlos_AB

2016-06-03 11:31 GMT-03:00 Petko Yotov <5ko at 5ko.fr>:
> 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
>>
>



-- 
Codex - Educação sobre tecnologias web
http://codex.wiki.br/



More information about the pmwiki-users mailing list