Re: [pmwiki-devel] Anchors in includes

2012-04-22 Thread Petko Yotov
On Sunday 08 April 2012 13:11:19 Patrick R. Michaud wrote:
 The problem appears to be the definition of $npat on line 1266 of
 pwmiki.php:
 
 $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).

Actually, the #start..#end pattern is not documented, #start#end is. The 
easiest way to allow #a1.2 sections while keeping the #start..#end working 
is to allow dots, and just strip the possible two trailing dots in the first 
section name.

If I don't see some problem with this solution, I'll add it to the next 
release later this month.

 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.

Both fixed. 

Thanks,
Petko


___
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel


Re: [pmwiki-devel] Anchors in includes

2012-04-08 Thread Patrick R. Michaud
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 definition
 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 pwmiki.php:

$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.

Pm


___
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel


Re: [pmwiki-devel] Anchors in includes

2012-04-08 Thread Simon
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

Simon

On 9 April 2012 06:11, Patrick R. Michaud pmich...@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
 definition
  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
 pwmiki.php:

$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.

 Pm




-- 

http://kiwiwiki.co.nz
___
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel


[pmwiki-devel] Anchors in includes

2012-04-07 Thread Simon
http://www.pmwiki.org/wiki/Test/IncludeAndAnchor

I am having difficulty with including content from another page where the
anchor is of the format [[#sec1.2]]
[1http://ttc.org.nz/pmwiki/pmwiki.php/TararuaFootprints/ClassicRoutes
]
I'm wondering if the include statement does not correctly accept all anchor
names?

Simon
___
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel


Re: [pmwiki-devel] Anchors in includes

2012-04-07 Thread Petko Yotov
On Sunday 08 April 2012 12:12:35 Simon wrote:
 http://www.pmwiki.org/wiki/Test/IncludeAndAnchor
 I am having difficulty with including content from another page where the
 anchor is of the format [[#sec1.2]]

Currently, the included sections should start with a letter, followed by 
letters, digits, simple dash - or underscore _ characters.

I suppose you could select one of [[#sec12]], [[#sec1-2]] or [[#sec1_2]].

Petko


___
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel