Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Need to know how to include square brackets in HTML text!

by merlyn (Sage)
on Apr 30, 2000 at 18:55 UTC ( [id://9754]=monkdiscuss: print w/replies, xml ) Need Help??

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

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 & l t ; for < and & g t ; for >.

    The square brackets are & # 0 9 1 ; for [ and & # 0 9 2 ; for ]. (Remove the spaces, of course.)

      <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' \ ?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-29 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found