[pmwiki-users] RFC: Core candidate offerings

Joachim Durchholz jo at durchholz.org
Sun Apr 2 12:23:00 CDT 2006


Patrick R. Michaud schrieb:
> HTML's definition of the <p> tag says that it is not allowed to
> contain other block markup, such as <li> or <pre>.  Semantically
> this is equivalent to saying that an author is not allowed to
> place a list, quotation, or display in the middle of a sentence
> or paragraph.
> 
> Semantically, such a notion is preposterous, and I don't know why
> W3C allowed this brain-damaged interpretation of <p> to persist
> into HTML 4 and XHTML 1.0.

I agree with that analysis.

However, I see a way out of this mess that looks more like the spirit of 
the standard that <p style="vspace">:

1) Use zero vertical margins around <p>, lists, <pre> etc.
2) Build our own "logical paragraphs" from <p>s, lists, <pre>s etc., 
wrap them in <div class="p">...</div>. Use a definition for div.p to 
define top and bottom margins. (PmWiki could use <p class="p">...</p> as 
a shorthand for <div class="p"><p>...</p></div>, and mandate that style 
sheets define something for *.p in general, but that's just an 
optimization.)
3) List items may be logical paragraphs, or <p>s, lists, <pre>s etc. 
(HTML allows both block-level and inline elements inside <li>...</li>.) 
This gives PmWiki the ability to create "small" lists and "large" lists 
as detailed in my other, recent post.

Advantages:
a) We can take advantage of vertical margin coalescing (which is, I 
think, important if we wish to have well-rendered pages).
b) I just looked up the sections on <p> in the HTML 4.01 standard and 
found that "rendering agents may ignore empty paragraphs". So if the 
next version of Opera, Mozilla or IE ignores <p class="vspace></p> and 
doesn't even generate the vertical space, then that's not a bug, it's a 
feature...

Regards,
Jo




More information about the pmwiki-users mailing list