[pmwiki-users] Weird PageTextVar behavior (bug?)

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 27 10:59:44 CST 2007


On Tue, Feb 27, 2007 at 10:45:38AM -0600, Patrick R. Michaud wrote:
> On Tue, Feb 27, 2007 at 04:33:54PM +0100, Petko Yotov wrote:
> > Hello,
> > 
> > There is a problem with PageTextVariables with the latest beta: it is 
> > sometimes impossible to set such a variable with the markup:
> > 
> > (:MyVar:Some value:)
> > 
> > I have set five demo pages at http://pmwiki.org/wiki/Test/PTV-Petko1 if anyone 
> > wishes to look at it.
> > 
> > What is weird, sometimes it works, sometimes it does not. 
> > Actually, I wish it always worked.
> 
> It appears to have something to do with the (:markup:) [=...=]
> surrounding the page text variables.  When I move the page text
> variables out of the (:markup:) directive, everything works.

Ah, I found it.  The page text variable pattern is being confused
into thinking that (:markup:) is a page text variable.  So,
when PmWiki sees something like

    (:markup:) [=
    (:MyVar:Some value:)
    =]

it's treating the (:markup:) rule as defining a page text variable
called "markup" with the value ") [=\n(:MyVar:Some value" , and
therefore misses the (:MyVar:...:) definition entirely.

I think the solution is to simply say that a page text variable
defined using (:TextVar:...:) cannot have a closing paren immediately
following the second colon.  That's what most authors will expect.

To get a closing paren at the beginning of a page text var using
this markup, one would have to write   (:TextVar: ) ... :),
and we'll likely strip the leading spaces.  But this is terribly
uncommon anyway.

Thanks for catching this!

Pm



More information about the pmwiki-users mailing list