[Mediawiki-l] <pre> without styling

Frederich, Eric P21322 eric.frederich at siemens.com
Fri May 4 18:32:11 UTC 2007


The <div style="white-space: pre;"> idea doesn't work like <pre> does.
Some things don't show up at all when you have the div inside of a
template.
Also, if you start a line with a space it puts a border around it
anyway.

Look at how this renders.

<div style="white-space: pre;">a
 b
  c
   d
    e
   f
  g
 h
i</div>

Looks like I'll have to go the class route.

It may be easier moving the styled <pre> into a class rather than
creating a new <pre> style class and explicitly undoing all of the
styling.

~Eric

-----Original Message-----
From: mediawiki-l-bounces at lists.wikimedia.org
[mailto:mediawiki-l-bounces at lists.wikimedia.org] On Behalf Of Dantman
Sent: Friday, May 04, 2007 2:18 PM
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] <pre> without styling

Frederich, Eric P21322 wrote:
> Is there a way to enclose stuff in <pre> </pre> tags and have them
> rendered without the box?
>
> The box is nice sometimes, but not so nice other times.  I would like
to
> selectively use it.
>
> Thanks,
> ~Eric
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>   
Not specifically, but you can achieve a similar effect just with styles.

The only thing that really makes a pre act the way it does is 
white-space: pre; so if you use <div style="white-space: pre;">Pre 
text</div> it will act like a HTML pre tag but it won't add the styling 
that MediaWiki adds to pre tags. Alternately you could create a .nopre 
css class which would reverse the styling of the pre defined in the 
Monobook's css and use <pre class="nopre">Pre text</pre>.

~Daniel Friesen of The Gaiapedia and Wikia Graphical Entertainment
Project

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l



More information about the MediaWiki-l mailing list