[pmwiki-users] How do I control $HTMLVSpace?

Patrick R. Michaud pmichaud at pobox.com
Thu Aug 25 14:16:16 CDT 2005


On Thu, Aug 25, 2005 at 10:00:54AM +1200, John Rankin wrote:
> On Thursday, 25 August 2005 3:55 AM, Jonathan Scott Duff <duff at pobox.com> wrote:
> >On Wed, Aug 24, 2005 at 01:07:43PM +1200, John Rankin wrote:
> >> Is there a way to ask pmwiki to insert something other 
> >> than $HTMLVSpace to space out a list?
> >> 
> >> * item 1
> >> 
> >> * item 2
> >> 
> >> * item 3
> >> 
> [...]
> So the only answer I have been able to think of is an 'after
> block' rule that looks for
> 
>   <p class='vspace'></p>(<\/tbook:.*?>)?<tbook:(.*?)>
> 
> and turns it into (for example; actual output depends on $2)
> 
>   $1<tbook:$2 skip='big'>
> 
> This relies on pmwiki not changing the rules, so is not
> great, but will probably work.
> 
> But it seems to me that a better way would be to create
> correct xml markup in the first place.

Unfortunately, according to many people "correct xml markup"
doesn't really exist here, because we're conflating semantics
(list item) with presentation (a blank line before the list item).

However, this indirectly answers your question -- rather than try to
patch things up after processing the list markup, write two separate
list markup rules -- one for list items following a blank line, and
another for all other list items.  (This would probably have to happen
prior to the "split" markup.)

Another possibility is to check PmWiki's internal vspace counter,
held at $MarkupFrame[0]['vs'].  This contains any vertical space
elements leading up to the current line.  So, if $MarkupFrame[0]['vs'] is
non-empty, you know that there were blank lines prior to the current
one.

Also note that in 2.0.beta55 the internal representation of "blank line"
has changed a bit; blank lines are now represented by '<:vspace>'
instead of a line containing only whitespace characters.   (Yes,
I know this has the unfortunate potential of breaking a few
scripts, but it was the least of several evils.  Let me know what
recipes break as a result and I'll take it upon myself to create the
appropriate fix for each.)
    
Pm




More information about the pmwiki-users mailing list