G'day siberia-man,

There's a lot of good advice already. Here's some additional information, which I didn't see posted, and mostly reflects my usage (garnered over the last decade).

The <pre> tag is useful when the content contains non-ASCII characters which may be rendered as character references when <code> tags are used. For in-line, as opposed to block, content I use the <tt> tag. Everything already said about <pre> (e.g. escaping characters) also applies to <tt>. Compare these smilies: &#9786; and (the 1st uses <c>; the 2nd uses <tt>).
[Note: Rendering of non-ASCII characters may be dependent on various things such as browser capabilities and available fonts.]

Be aware that <code> tags wrap lines (the 2nd and subsequent parts are introduced with a +); however, <pre> tags won't do this. Keep an eye on the length of lines in <pre> blocks; and bear in mind that indentation from "Re:", "Re^2:", ..., "Re^N:" posts will affect wrapping.

You can nest <c> inside <code> and vice versa. The two pieces of markup I used there were: <code><c></code> and <c><code></c>.

You can enter [ and ] using &#91; and &#93;, respectively; e.g. [not a link] which I marked up as just "&#91;not a link&#93;" (i.e. no tags needed here).

— Ken


In reply to Re: Test post for <code> and <pre> by kcott
in thread Test post for <code> and <pre> by siberia-man

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.