2009/10/5 The Editor <[email protected]>:

> However, it does suggest a solution though...  What if when injected a
> snippet into a zone, we simply processed these prior rules only, then
> injected it as raw markup from that point on--as you suggest. This way
> we would not lose any functionality, solve all these sorts of
> escape/unescape problems, and not require any special code in
> functions/conditions. It also saves processing time--as we only do the
> processing we need when we want to.
>

Yes, this makes total sense. Its like Pmwiki's PRR function: Redo Ruleset.
I guess BOLTdomarkup($out, '', '', 'pre'); restarts at the 'pre' stage?

The new BOLTMsnippets() behaves fine so far.

BTW:
why do you need to strip enclosing <p> </p> tags? Where would they come from?

I would write:

                if ('<p>' . substr($out, 3, -4) . '</p>' == $out)
                        $out = substr($out, 3, -4);
as
               $out = preg_replace("/^<p>(.*?)<\\/p>$/s", '$1', $out);

to strip out enclosing <p> </p> tags.
It is not slower and easier to read for me.

In fact, depending on the <p>..<p> replacement, you could write the
whole BOLTMsnippets function like this:

function BOLTMsnippets($var, $page='', $rules) {
## TAKES SNIPPETS AND PREPARES FOR DISPLAY IN PAGE OR SKIN
        $out = BOLTdomarkup(BOLTsnippets($var, $page), '', '', $rules);
        return preg_replace("/^<p>(.*?)<\\/p>$/s", '$1', $out);
        }

I replaced $skin with $rules to use the value directly in the BOLTdomarkup call.
It needs further change to markups.php line 18 Markup('pre', 'snippets',
add third argument to BOLTMsnippets call: "pre":
     Markup('pre', 'snippets', '/......./e', 'BOLTMsnippets("$2",
"$3", "pre")');
and change to engine.php function BOLTloadpage line 1495
change third arg of BOLTMsnippets to '' or false
        $out = preg_replace('/....../e', "BOLTMsnippets('$2', '$3', false)", 
$out);

cheers,
Hans

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to