G'day perl-diddler,

Regarding what it says below the input window, maybe changing "... put the characters ..." to "... put these characters ..." would clarify which characters this statement references.

The reason why things are the way they are, is to allow code like this:

sub amp { ... } my $coderef = \&

Unfortunately, your request would render that as:

sub amp { ... } my $coderef = \&

The workaround is to use 'pre' tags instead of 'code' tags for blocks (and 'tt' tags for inline text):

This pi (π) using π does display correctly.
This pi (π) using π does display correctly.
This pi (π) using π does display correctly.
This pi (π) using literal pi character does display correctly.

[Note: On previewing, I noticed that the literal pi character that I pasted into that last example now appears as π in the textarea.]

Use this workaround sparingly as you don't get a [download] link. Also, line wrapping (or absence thereof) can be problematic so aim to keep lines short (I think <= 72 characters is optimal, inasmuch as it doesn't mess up normal page layout).

— Ken


In reply to Re: BUG: code blocks don't retain literal formatting -- could they? by kcott
in thread BUG: code blocks don't retain literal formatting -- could they? by perl-diddler

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.