[Pmwiki-users] Re: new directive tag syntax (was: Pmwiki new version)

Patrick R. Michaud pmichaud
Sat Jun 12 11:49:37 CDT 2004


On Sat, Jun 12, 2004 at 03:58:47PM +0200, Christian Ridderstr?m wrote:
> Why don't you compare your example with:
> 	(.search (.$Group.)/ text.)
> where there is also a dollar sign in front of 'Group'. 

This works for me.

> Actually, why not 
> simply introduce a directive that shows the value of a variable. This 
> directive could simply be a '$' like this:
> 	(.$<variable-name>.)

...because I figure it's not a good idea from a security point of view
to allow authors to be able to access arbitrary variables through the
markup.  In general it's probably okay, but some people may not want
pathnames or the like to be availab.e

> Another 
> alternative could be to simply allow:
> 	[:search $Group/ text:]
> but I guess that then we'd have to introduce quoting, i.e. if you 
> literally want to search for '$Group', you'd have to write:
> 	[:search [=$=]Group/ text:]

and this would be nasty, because I figure that $-phrases are more
often taken literally than they are meant to be a substitution.
That's certainly been the case in all of the PmWiki pages.

> > nested directives with the same syntax can make the programming side of
> > things *much* more complicated
> 
> Do you mean that we'd need a recursive parser, or that the regular
> expressions becomes complicated?

The regexps become much more complicated, because they have to understand
nested parenthesis and phrases (and there's not an easy way to say
"any sequence of characters that doesn't include '.)'".

> Or possibly one of the following
> 
> 	Assigning title				Extracting title
> 	(.title := My page's title.)		(.title.)
> 	(.$title := My page's title.)		(.$title.)
> 	(.${title} := My Page's title.)		(.${title}.)
> 
> My point is that since we're assiging the title, we could simply make this 
> apparent from the syntax.

Apparent to programmers maybe, but this is really likely to scare off
authors because it *looks* like programming.

Pm



More information about the pmwiki-users mailing list