[pmwiki-users] PTVs on multiple lines

Hans Bracker design at softflow.co.uk
Sun Oct 18 07:03:42 CDT 2015


I like to question the PTV definition for simple text and definition
list PTVs. (pmwiki.php line 156):

  'var:'        => '/^(:*\\s*(\\w[-\\w]*)\\s*:[ \\t]?)(.*)($)/m',

I created a test page to demonstrate this:
http://www.pmwiki.org/wiki/Test/MultilinePTVs

I do not see the point why the pattern allows the colon to be on the
line below, or even several lines below. I think it should not allow
this. So cases 2, 3 and 5 should not be rendered as PTVs.
(In case 5 the definition list item is not rendered as such, but as PTV
nonetheless, but this is beside my point)

For PTVs as directives (I call them hidden PTVs) the middle colon on
a subsequent line is disallowed (case 7), which is good, and the
variable text can span multiple lines (cases 8 and 9), which is also
good, and I use this  a lot.

This issue of having the colon on the next or later line came up for
me when writing a new script, with a part checking for PTVs, where
for a hidden PTV as in case 8 or 9 also a text PTV was rendered, with
the last part of the hidden PTV value. So for

(:hidden:
some
text:)

also text:) was seen as a PTV with name 'text' and value')'

To resolve the issues I like to request that the pattern be changed to
disallow the colon on the next line(s), i.e. to:

  'var:'        => '/^(:*\\s*(\\w[-\\w]*)[ \\t]*:[ \\t]?)(.*)($)/m',

Maybe I missed something important why the pattern allows th ecolon on
a next line, but otherwise this could be a PITS entry.


Best regards,
 Hans      




More information about the pmwiki-users mailing list