[Pmwiki-users] Minor formatting suggestion: <p /> after lists

Joakim Erdfelt joakim
Tue Sep 23 06:50:11 CDT 2003

Nathan Jones wrote:

>[Repost - first attempt (on Friday) disappeared.]
>I have a minor suggestion to consider for a future release of this
>wonderful wiki software.
>This input:
>! Heading
>Paragraph one.
>* List item
>Paragraph two.
>Gives this output:
><p /><h1> Heading</h1>
><p />Paragraph one.
><p /><ul ><li> List item
><p /></li></ul>Paragraph two.
>Put the <p /> generated by the second blank line after the </ul> instead
>of before it.
>In the above sample, paragraph one is treated as a paragraph (<p>) by the
>browser, but paragraph two is not - it is just loose text owned by the
><body>, not by another element.
I'd like to add that the use of empty paragraph <p /> tags is
against web standards.

HTML Spec:

  The P element represents a paragraph. It cannot contain block-level
  elements (including P itself).

  We discourage authors from using empty P elements. User agents should
  ignore empty P elements.

Also, according to the XHTML spec:

  C.3. Element Minimization and Empty Element Content

  Given an empty instance of an element whose content model is not
  EMPTY (for example, an empty title or paragraph) do not use the
  minimized form (e.g. use <p> </p> and not <p />).

See DTD definitions:

Notice that the content is not labelled as "EMPTY"?

>Also, the same thing occurs with some other elements - so far I've
>noticed <pre> tags generated from:
> [=
>...are immediately followed by the text of the next paragraph.
>When this makes a difference:
>If you have a style sheet that applies a style to the p element, it won't
>apply to the text following a list. In my case, I have added a
>margin-left style to indent all paragraphs slightly. "Paragraphs" after
>tables do not get indented.
I've noticed that the <pre></pre> tags also show up in preview mode, but
not in regular browse mode. 

See demo at: http://www.pmichaud.com/wiki/Demo/PreTagPreview

>I don't know if this would cause some problem I haven't thought of and I
>don't know how feasible/easy it is programming wise. I guess a kludgy
>workaround would be to output a <p /> after each </ul> or </ol>,
>resulting in: <p /></ul><p />
Looking at Patrick's code, it would seem to me that it would impact a good
portion of the code.  Patrick can comment better on this tho. ;-)

/* joakim */

More information about the pmwiki-users mailing list