W3C home > Mailing lists > Public > www-style@w3.org > May 2006

Deep nesting of quotes

From: Simon Montagu <smontagu@smontagu.org>
Date: Tue, 16 May 2006 12:17:55 +0400
Message-ID: <44698AB3.6080603@smontagu.org>
To: www-style@w3.org

http://devedge.entangledesign.com/sidebars/css2.1/CSS21/generate.html#quotes-insert
and http://www.w3.org/TR/css3-content/#inserting2 both say:

"Which pair of quotes is used depends on the nesting level of quotes: 
the number of occurrences of 'open-quote' in all generated text before 
the current occurrence, minus the number of occurrences of 
'close-quote'. If the depth is 0, the first pair is used, if the depth 
is 1, the second pair is used, etc. If the depth is greater than the 
number of pairs, the last pair is repeated."

So, assuming

  q, cite { quotes: '\27' '\27' '\22' '\22' }
  q:before, cite:before { content: open-quote }
  q:after, cite:after { content: close-quote }

the following HTML fragment

  <p>I said <q>Tony Hazzard wrote <cite><q>Ha ha</q> said the 
clown</cite></q></p>

would be rendered

  I said 'Tony Hazzard wrote ""Ha ha" said the clown"'

and

  <p>The testcase is <q>I said <q>Tony Hazzard wrote <cite><q>Ha ha</q> 
said the clown</cite></q></q></p>

would be rendered

  The testcase is 'I said "Tony Hazzard wrote ""Ha ha" said the clown""'

This doesn't seem to correspond to typographic practice (at least in the 
UK), where nested quotes typically cycle between single and double 
quotes to any depth, i.e. I would expect

  I said 'Tony Hazzard wrote "'Ha ha' said the clown"'".

and

  The testcase is 'I said "Tony Hazzard wrote '"Ha ha" said the clown'"'
Received on Tuesday, 16 May 2006 09:12:42 GMT

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