[pmwiki-users] No <p> between tables with $HTMLVSpace = '';

Petko Yotov 5ko at 5ko.fr
Fri May 17 14:31:11 CDT 2013


Oliver Betz writes:
> is anybody using $HTMLVSpace = ''; and knows how to get a <p> between
> two tables separated by empty lines in Wiki markup?

I am not using it this way, but I might know how to get it done.

This code in config.php should automatically insert a temporary " "  
between two simple tables, early in the markup processing, before tables and  
paragraphs are processed, so you don't have to add it yourself.

    Markup('|vspace', '>\\$',
      "/^(\\|\\|(?>[^\n]+))(?:\n<:vspace>)+(\n\\|\\|)/m",
      "$1\n $2");

This will actually convert 1, 2 or more empty lines between two tables in  
the markup to a single paragraph in the output.

If vertical space is really important for your wiki, the built-in and  
recommended way to handle is to not set $HTMLVSpace = ''.

Petko


> For example, this markup:
>
> || border=1
> || cell 1 || cell 2 ||
> || cell 1 || cell 2 ||
>
>
> || border=1
> || cell 1 || cell 2 ||
> || cell 1 || cell 2 ||
>
> should result in two tables with an empty <p> between.
>
> My workaround is to put a nbsp between the tables, but I would prefer
> if wouldn't need to explain this to the editors.




More information about the pmwiki-users mailing list