A LIST Apart: For People Who Make Websites

No. 263

Discuss: Long Live the Q Tag

Pages

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | next »

1 Q in XHTML 2

It’s worth noting the XHTML 2 spec (working draft) calls for browsers to not render quotes around Q tags.

Visual user agents must not by default add delimiting quotation marks (as was the case for the q element in earlier versions of XHTML and HTML). It is the responsibility of the document author to add any required quotation marks, either directly in the text, or via a style sheet.

From: http://www.w3.org/TR/xhtml2/mod-text.html#sec_9.8.

I’m looking forward to the BLOCKCODE and L tags, myself.

posted at 05:26 am on September 26, 2006 by Chris Botman

2 Code problems...

Hi. In the code examples in the article, the HTML entities are incorrectly being shown. For example, this is what it should show:

Did you know “<q>The quick brown fox jumps over the lazy dog</q>” contains every letter of the alphabet?

But, instead, it should be:

Did you know “<q>The quick brown fox jumps over the lazy dog</q>” contains every letter of the alphabet?

The ” et al examples area also being displayed like so ”, which is, of course, incorrect.

(That is, it’s not what the writer intended, as the entities used within writing the essay for displaying the <q> tags are also dispalys as <q>.)

M.T.

posted at 05:32 am on September 26, 2006 by Matt Todd

3 Curious...

See, it just happened to that post as well. It’s HTML Identifying the content inside of the <code> tags as well. (That is, those of which that are being wrapped in the at sign (@).)

M.T.

posted at 05:34 am on September 26, 2006 by Matt Todd

4 Correct Quotes

As soon as you still need to fix quotes to their correct entities it is sounds as a good point to actually redefine these quotes or put them in HTML as it was suggested. Also take into account that different languages using different quotes (sometimes), so you can’t really rely on browser. I think that web, including really modern browsers, is not really grown up for Q tag yet. IE just the worst, but neither of others is good.

posted at 05:36 am on September 26, 2006 by Dmitry Baranovskiy

5 Thanks, Matt

You caught me in the middle of fixing a Textile/HTML fight in the code example. All’s well now. As for your own comment, same thing—your HTML is fighting with Textile. We’re working on a new comment system even now.

posted at 06:30 am on September 26, 2006 by Erin Kissane

6 Server-side solution

If your pages are being processed by the server each time they’re accessed (perhaps by a templating engine), you may be able to write some simple code to transform <q> tags when the visiting browser is IE. I use this approach on one of my sites&mdash;it substitutes &amp;ldquo; and &amp;rdquo; for <q> and </q>, but only if the User-Agent header claims to be IE. Browsers that can handle <q> get it, and IE gets a slightly degraded but correctly-rendered version.

posted at 07:20 am on September 26, 2006 by Brent Royal-Gordon

7 Correction

Looks like there’s a bug in the preview—it processes HTML entities when the server’s code doesn’t. The second sentence should read:

I use this approach on one of my sites—it substitutes &ldquo; and &rdquo; for <q> and </q>, but only if the User-Agent header claims to be IE.

posted at 07:22 am on September 26, 2006 by Brent Royal-Gordon

8 The multi-lingual issue

I’ve been using this solution for a while. I’m not too keen on it though. It essentially removes good rendering behaviour from good browsers in order to facilitate bad mark-up behaviour by authors to accommodate bad rendering behaviour by buggy and soon-to-be-obselete browsers.

I recognise the JavaScript solution doesn’t deal with IE(Internet Explorer) lte(less than or equal to) 6 users who have scripting disabled, but that will be a shrinking population once IE(Internet Explorer) 7 comes out.

So, I say add a script element between your conditional comments, and take it out when IE(Internet Explorer) 6 finally dies out.

http://juicystudio.com/article/fixing-ie-quotes.php

posted at 08:18 am on September 26, 2006 by Paul Waite

9 NO CSS SUPPORT

I ran through your example and found it did indeed display correctly, great!

Until of course I viewed the page in a text browser and found the quotation marks were being displayed twice.

This is because obviously there is no CSS support in text browsers and without CSS support you cannot hide the text browsers default style for the Q tag which is to show quotation marks.

Any suggestions yet on getting around the lack of CSS support?

posted at 08:33 am on September 26, 2006 by Mark McDonnell

10 Hurrah!

I’ve spent ages trying to argue with people that the way to do it most effectively was to tell the other browsers not to add quotes from CSS and then manually put them in, and finally someone agrees – and whats more, gets it published on ALA.

Well done, Stacey!

Of course, there is one flaw: any browsers which render quotation marks around <q> by default but do not support css will end up with two sets of quotation marks. But frankly as this is likely to be well under 1% of any audience, you’re better off catering to IE’s much bigger market share.

posted at 08:36 am on September 26, 2006 by Jack Pickard

Pages

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | next »

Discussion Closed

New comments are not being accepted, but you are welcome to explore what people said before we closed the door.