[pmwiki-users] PmWiki DocumentationGuidelines

Patrick R. Michaud pmichaud at pobox.com
Sat Mar 11 18:46:52 CST 2006

On Sun, Mar 12, 2006 at 12:27:05AM +0000, Hans wrote:
> And why does [@some text@] produce <code> ....</code>
> but this
> [@ some text
> some text @]
> produces <pre> ...<pre> ?

There are several reasons, most of which have to do with
the difference between inline and block markup.  By default,
<code> doesn't honor linebreaks, so in HTML


is rendered on a single line.  Thus, PmWiki looks for
a newline in the [@...@] text, if it doesn't find one
it uses <code> (so it can be inlined in a paragraph), 
otherwise it uses <pre> (which cannot be inlined in
a paragraph but must be a separate block).

> Should not [@...@] and @@...@@ produce <code>,
> and indented text produce <pre> ?

[@...@] can always produce <code> only if we're willing to
trust CSS to force it to act like a block (i.e., display:block)
and that the "white-space:pre" property will work.  Personally,
I think it's better to have it generate separate <code> and
<pre> output depending on whether the contents are inlined
or block.

> Would it not be good to distinguish one from the other?
> <code> and <pre> could get different styling, different font etc

Because of the inline versus block requirements, I think the way
to control styling is probably better done with some useful
CSS classes in the output rather than trying to use <code> and
<pre> as the (sole) selectors.


More information about the pmwiki-users mailing list