Ah, but it ain’t logical at all... I’ve just written my own argument parser for a CRUD project I’m working on, so I know that one COULD write regular expressions to match any data between the back-ticks as the parameter value, e.g.
So really my question was what exactly is the behavior of the regex’s that grab Snippet parameters. Why doesn’t the parser iterate over the Snippet string like this:
$snippet_pattern = '/^(.*)\s*\?/';
$str='Snippet? ¶m1=`value one` ¶m2=`<a href="surprise">;) & :O</a>`';
// First match is the Snippet name. Then, trim off the Snippet name from the $str... then you have:
$str='¶m1=`value one` ¶m2=`<a href="surprise">;)</a>`';
$param_pattern = '/^\s*\&([a-zA-z0-9)\s*\=\s*\`(.*)\`/U';
// First match is the parameter name, Second match is the value
// repeat until you got all the parameters/values...
If it was done that way the only "off-limit" character would be the back-tick. There’s already been a fair amount of grief for people wanting to use html-entities as Snippet arguments, e.g. WebLoginPE using "&" to separate drop-down values. And lots of folks fall into the trap that Snippets fail to execute when the calls use more than one line (I know that behavior isn’t consistent across browsers, but a regex tweak could probably fix it).
My own frustration with this is when I want to pass in super-short strings to be used as chunks. It takes a speed hit to go look up in the db a one-line chunk when I could just specify it in the Snippet parameters. There are work-arounds... but... meh... am I missing something?