[Pmwiki-users] vspace paragraphs

Patrick R. Michaud pmichaud
Wed Nov 3 15:42:27 CST 2004


On Wed, Nov 03, 2004 at 09:08:54PM +0000, Val Sharp wrote:
> As a champion of standards in HTML and CSS, I find the use of 
> paragraphs solely to create vertical space less than ideal.
> 
> Is this actually still necessary, or simply a legacy from the original 
> way that PmWiki generated HTML?
> [...]
> Might we not dispense with the 'vspace' paragraphs, and style margins 
> on P elements to create the desired vertical spacing?

Sure, it's possible to eliminate vspace paragraphs--even as a local 
customization.  If you want to eliminate the vspace paragraphs, just set
$HTMLVSpace=''; in config.php.

However, I don't think it's possible to get the margins on P elements
to create the vertical spacing that I want.  By default, <p> (and <pre>
and top-level <ul>, <dl>, <ol>) tend to want to put vertical space
before and after the element.  Thus, using standard browser defaults, 
the markup:

    My grocery list contains
    * apples
    * bananas
    * cherries
    and must be filled by tomorrow afternoon.
   
gives me a line before "apples" and after "cherries" whether I want it
or not.  (Not to mention the fact that HTML requires that I mark this
as being two separate paragraphs with a list between them, which is
semantically incorrect.)

Similar rules apply for <pre> elements and other list types.  
Yes, there's a stylistic argument to be made that such displayed elements 
should always have white space before and after them, however there are lots
of times when I want to be able to have my preformatted text or lists
immediately following the previous element without the extra whitespace 
(e.g., in PmWiki.Variables).

So, PmWiki takes the approach that blank lines in the markup result in
blank lines in the output, and achieves this by setting the vertical margins
in <p>, <pre>, etc. to zero and explicitly adding in <p class='vspace'>
where the user requested blank spaces.

So, personally I'm in favor of keeping PmWiki's current default (in
which the output looks like the markup), and providing customization
information for those who want to revert to what HTML thinks is correct.

However, if anyone can show me a set of margin stylings that achieve
the effect I want without the use of <p class='vspace'>, I'm willing
to take a look.

Pm



More information about the pmwiki-users mailing list