[Wikitext-l] The <pre> tag

Jared Williams jared.williams1 at ntlworld.com
Fri Dec 7 13:52:06 UTC 2007


 

> -----Original Message-----
> From: wikitext-l-bounces at lists.wikimedia.org 
> [mailto:wikitext-l-bounces at lists.wikimedia.org] On Behalf Of 
> Mark Clements
> Sent: 07 December 2007 12:57
> To: Wikitext-l
> Subject: Re: [Wikitext-l] The <pre> tag
> 
> From: "Platonides" <platonides at gmail.com>
> > Steve Bennett wrote:
> > > Would it be reasonable to restrict the use of <pre> to:
> > > - General paragraph texts, but not internal or external link 
> > > captions
> > > - Image captions
> > >
> > > Perhaps anywhere else it could be either treated as equivalent to 
> > > <nowikI>, ignored, or rendered literally?
> >
> > IMHO we should differentiate between inline tags and block tags. As 
> > we're translating wikitext into xhtml, using its same type of 
> > restriction makes sense.
> >
> > So an image caption would onmly be allowed to contain inline tags. 
> > <pre> is a block tag.
> >
> > We could:
> > a) Render <pre> literally [blinking] in red so the user perceives 
> > there's a syntax error.
> > b) Refuse to save (bad).
> > c) Use a <span with pre-like format (is it really useful? 
> It means a 
> > different )
> > d) Move the <pre> to the next position where it makes sense.
> 
> Or of course:
> e) Render it literally without making it look ridiculous.
> 
> Here's my thoughts on the above options:
> a) No - use (e) instead.
> b) Never refuse to save
> c) This is a possibility.  However we would need to make this 
> behaviour consistent across the whole parser, e.g. <pre> tags 
> inside a paragraph should be treated as in-line as well.  
> This would possibly be quite useful, but would no doubt break 
> existing pages.  It is also conceptually a bit confusing and 
> may cause problems with the default styling rules (which add 
> padding and borders etc. which may look pretty bad for 
> in-line elements).

WikiCreole uses <tt> in xhtml for inline preformatted text. If the
preformatted token ({{{ in creole's case) is on the start of the line, its
considered a block, otherwise inline. Seems fine to me, but not sure if can
apply the same ruling to mw <pre>.

> d) I don't think this is a good idea - it almost certainly 
> isn't what was wanted and makes the problem harder to track down.

This is what I currently do.

> e) The one I would choose if (c) is not viable.
> 
> - Mark Clements (HappyDog)
> 
> 
> _______________________________________________
> Wikitext-l mailing list
> Wikitext-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/wikitext-l




More information about the Wikitext-l mailing list