Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

pre tag

by pg (Canon)
on Oct 17, 2004 at 22:10 UTC ( [id://399984]=monkdiscuss: print w/replies, xml ) Need Help??

The thread led by Logic trouble parsing a formatted text file into hashes of hashes (of hashes, etc.) is super wide, when I view it with Opera. It is okay with IE.

I think the problem was that one of the reply Re: Logic trouble parsing a formatted text file into hashes of hashes (of hashes, etc.) used pre tage around its example source code.

Please avoid pre tag, whenever it is possible

(I brought this up, as this happened quite often recently.)

Replies are listed 'Best First'.
Re: pre tag
by tstock (Curate) on Oct 18, 2004 at 02:19 UTC
    Maybe some CSS could help out - in this case, it has to be browser specific :
    pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ }

    Tiago
Re: pre tag
by tye (Sage) on Oct 18, 2004 at 05:22 UTC
    pre tag

    ... is super wide, when I view it with Opera. It is okay with IE.

    PRE tags do not stop being 'wide' when you switch browsers.

    (I brought this up, as this happened quite often recently.)

    Perhaps you turned on "auto" code wrapping recently? Please read Re^2: Monastery Gates page is too wide (causes), for my most recent discussion of this.

    - tye        

Re: pre tag
by bart (Canon) on Oct 18, 2004 at 10:15 UTC
    Which makes me wonder: why is the PRE tag actually among the allowed HTML tags?

      I am all for the <pre> tag here at the Monastery. Keeping with the spirit of Perl, there is more than one way to do it. I can post DATA with <pre> tags and CODE with <code> tags. Notice how the d/l code link only displays what i want it to display:

      <xml>
         <foo>bar</foo>
      </xml>
      
      print while <DATA>;

      Just my two cents. Plus, i'd have to fix a lot of broken nodes if you took away my <pre> tag. ;)

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      

      There's a social reason, which I won't go into, as jeffa did a good job explaining it already. There's also a technical reason: we /first/ convert code tags to pre tags, /then/ we check for allowed tags. Twere it only easy to change...


      Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Re: pre tag
by ambrus (Abbot) on Oct 18, 2004 at 19:05 UTC

    The problem is not only that it's wide, but also that the code can not be downloaded easily.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://399984]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-26 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found