W3C home > Mailing lists > Public > www-style@w3.org > September 1996

Re: Right paren in urls

From: Jon Degenhardt <jrd@netcom.com>
Date: Wed, 11 Sep 1996 04:40:39 -0700
Message-Id: <199609111140.EAA10717@netcom.netcom.com>
To: bbos@mygale.inria.fr
CC: www-style@w3.org

Bert Bos writes:
 > The safe way to use a literal parenthesis, in a URL or elsewhere, is
 > to escape it with a backslash. Section 7.2 ("parsing conventions")
 > explains that any character can be escaped with a backslash to remove
 > its special meaning. The way to write the URL is thus:
 > 
 >     BODY { background: url(right\)paren.gif) }
 > 

Thanks much. This is exactly the information I needed. 

At the risk of pointing out well known stuff.... The reason I had guessed
at the quoting mechanism was because it would allow "safe" URLs to be
written the same way in the HTML Style element as any other HTML
element. For example:  

   <BODY BACKGROUND="right)paren.gif"> 
   <STYLE> BODY { background: url("right)paren.gif") } </STYLE>

This is a nice property for authors, and perhaps for certain kinds of HTML
parsing tools (e.g. constructing the second line from the first). The style
attribute doesn't work as cleanly, because single-quote is a "safe"
character in URLS. For example, both

   <BODY STYLE='background: url("right)paren.gif")'>
   <BODY STYLE="background: url('right)paren.gif')">

are fine, but if the right paren is replaced with a single-quote it doesn't
work as smooth. (Double-quote isn't a problem because it's not a safe
character.) Still, this idea might be worth considering.

Again, thanks much for the prompt reply.

--Jon Degenhardt
  DocuMagix, Inc.
Received on Wednesday, 11 September 1996 07:42:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:45 GMT