[pmwiki-users] PTVs on multiple lines

Petko Yotov 5ko at 5ko.fr
Mon Oct 19 04:47:44 CDT 2015

On 2015-10-19 10:49, Hans Bracker wrote:
> If cases like 'var:)' shall not be excluded, following your reasoning
> that a PTV may well start with a ')' character, then still I would
> argue that it seems wrong in the following case:
> (:hidden:
> var1: abc
> var2: def
> xyz:)
> as 'xyz' is clearly just the end of the text in the PTV 'hidden',
> and not intended to be read as a text PTV.
> A human reader will see this, and the system should see this as well.
> For my purpose I need to write code so 'xyz' is in this case not seen
> as a text PTV 'xyz:)', just the last line of text in the  'hidden'
> PTV.

If you don't need and use a random {$:xyz} variable, simply ignore it. 
We can use definition lists without the need to use them as page text 
variables -- if we don't use the variables, why does it matter that 
PmWiki is able to create them?

The code complexity required to *not* have a random "xyz:)" variable 
*only* at the end of a multiline PTV, but to *have* one outside of a 
multiline PTV is not worth the effort comparing to the perceived benefit 
-- such a variable is not used and will be ignored anyways.

If a recipe *requires* that complexity, the code should probably be in 
the recipe, not in the core.

> I also note that 'xyz:)' cannot be a nested PTV in 'hidden',
> unless it occurs right at the end, ie. as this example shows, which
> will break the 'hidden' PTV:
> (:hidden:
> var1: abc
> var2: def
> xyz:)
> 123
> :)
> I can see that for purpose of nesting PTVs a PTV markup is more useful
> if it avoids the ':' used in the text PTV definition, and I may need
> to adopt such an approach, failing to have code which filters out
> cases like 'xyz:)' at the end of hidden PTVs.

There is no "purpose" of nesting PTVs, it is a side effect -- it has 
worked for many years so people may use it (I do). Obviously what 
doesn't work is not used by anyone -- if it breaks their PTVs, people 
will change it.

I have no problem with the markup above -- an author could have the PTV 
end at "xyz:)", then on another line simply have a smiley. If we don't 
end it at the first ":)", we do not know where it ends. PmWiki should 
not pretend to read people's minds about what they might want, it should 
do what they have written. :-)

But a recipe that reads people's minds, that would be interesting and 
highly profitable. :-D


Change log     :  http://www.pmwiki.org/wiki/PmWiki/ChangeLog
Release notes  :  http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes
If you upgrade :  http://www.pmwiki.org/wiki/PmWiki/Upgrades

More information about the pmwiki-users mailing list