[pmwiki-devel] Anchors in includes
nzskiwi at gmail.com
Sun Apr 8 17:58:36 CDT 2012
Thanks for this.
It is rather tricky to parse.
The only was to correctly parse #NAME..#NAME is to find the second # and
the preceding double dots.
A NAME can valid syntactically include a double dot, eg #name1..2..#name3
On 9 April 2012 06:11, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Sun, Apr 08, 2012 at 11:14:54PM +1200, Simon wrote:
> > Thanks for the very prompt reply.
> > I believe that this is a bug then, include does not use the same
> > of an anchor token as does the code that parses links and anchors.
> The problem appears to be the definition of $npat on line 1266 of
> $npat = '[[:alpha:]][-\\w*]*';
> Note that simply adding a dot to the [-\\w]* part of the expression
> won't work, as a pair of dots are used to indicate ranges.
> It probably needs to be something that can recognize a single dot
> in the identifier pattern (i.e., a dot followed by something
> other than another dot).
> Also, I suspect the '*' immediately the \\w in the original is a typo.
> And there's an extraneous definition of $npat on line 1311 in the
> IncludeText() function, probably left over from a previous factoring
> of text includes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pmwiki-devel