Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
This by no means represents the official reason, it's simply my own thoughts on the reason behind the <code> tag.

It looks as if the tag is handled in a special way (just as the square bracket links are). The fact that you can select how code is displayed in user settings seems to indicate this. Currently it looks as if the <code> tag is treated as a <pre> tag.

One advantage of having the tag interpreted is that it's easy to change what it does either globally or by user. I imagine the term 'code' was chosen because the content is, in fact, code, so it ought to be easy to remember. Unfortunately it appears to be confusing as well. Using <pre> would also be confusing, because there's no guarantee <code> always is or will be directly converted to <pre> (<code> seems to be replaced with <pre><it> for me; if I turn off 'large code font' in my user settings, it replaces it with <pre><it><font size=-1>).


In reply to RE: RE: Automatic CODE tags (kudra: how/why CODE &gt; PRE) by kudra
in thread Automatic CODE tags by Odud

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-20 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found