So how do I get odd characters like square brackets or less-than or greater-than in the HTML text? I don't want to drop into "code" sections... they should be inline elements.

-- Randal L. Schwartz, Perl hacker

  • Comment on Need to know how to include square brackets in HTML text!

Replies are listed 'Best First'.
RE: Need to know how to include square brackets in HTML text!
by chromatic (Archbishop) on Apr 30, 2000 at 19:22 UTC
    You have to specify the characters by entities, like &lt; for < and &gt; for >.

    The square brackets are &#091; for [ and &#093; for ].

      <HTML>
      Sorry, had to try it....
      Simplicus
        Would it be too much to ask of the person who voted the above post down to explain why? thanks.
RE: Need to know how to include square brackets in HTML text!
by turnstep (Parson) on Apr 30, 2000 at 20:16 UTC
    Two things that might help here:
    • Have a small explanation or link to a page that explains how perlmonks parser requires some things to be escaped, and how to do it.
    • Have some semi-intelligent parsing, so that things like while(<>) do not have to be escaped, and perhaps even allowing something like "[*" to signify that a bracket is being used, and not a link
      Well it would make sence to add some thing to escape square brackets. What about a good ol' \ ?