A LIST Apart: For People Who Make Websites

No. 224

Discuss: Long Live the Q Tag

Pages

« First  <  2 3 4 5 6 >  Last »

31 Italicizing the q tag

For those who support italicizing the q tag to give it some sort of style, what else do you suggest be done for the tag if it was inside an inline level element that was already italicized? Sure, it’s easy to know you need to come up with something different for descendants of the em or i tags, but I’m sure anyone here can think of another example where it would be unexpected to know that this would happen ahead of time. What other style rules should be applied? This is why there is a need for user agents to support the auto-quote styling. It removes the ambiguity.

posted at 09:09 pm on September 26, 2006 by Brian LePore

32 Losing my hair

Because I’m going to be very critical afterwards, I’d like to begin by thanking Stacey Cordoni for sharing her technique with us. The more ideas are bounced around, the better for all of us.

Cordoni is mistaken to imply that this is an IE-only problem. Q is partially implemented by most user agents, but fully implemented by none. There is no language-sensitive implementation. The current version of ELinks will display Q in cyan in 16 color mode but does not differentiate Q in monochrome or 256-color mode.

I share the author’s commitment to “semantic markup” and her concern for “accessibility”, and empathize with her quixotic desire for “consistent visual display”. But her proposed solution, which provides none of these things, made me want to tear my hair out. Let me explain why:

1. The semantics of (X)HTML are defined by W3C specifications. Violating those specifications in order to create a “consistent visual display” is the exact opposite of writing “semantic markup”.

&ldquo;<q>The quick brown fox jumps over the lazy dog</q>&rdquo;

is not a quotation, but (if anything) a quotation of a quotation.

2. The display from this technique is not consistent, since quotation marks are doubled when CSS is unsupported, disabled, or overridden.

3. This proposal offers no clear accessibility benefit. Yes, if you have Window-Eyes you can configure it to announce the beginning and end of quotations. Yes, if you use EmacSpeak with the extinct Emacs/W3 browser, or Opera, you (or the page author) could apply an aural stylesheet to Q. But has anyone succeeded in configuring any other screen reader to use Q effectively? I’ve failed miserably with Jaws 7.10 and Hal (so far). So sophisticated screen readers may double the punctuation, while crude screen readers gain no benefit from Q’s presence. Some screen readers will read Q in the correct language following its “lang” attribute; but then a SPAN has exactly the same functionality.

Here’s an alternative suggestion that does not explicitly break the W3C specification, is displayed the same in all browsers, can be styled with aural CSS, and can be read in its proper language:

&#8216;<span class=“quotation” lang=“fr”>Bonjour!</span>&#8217;

If you want to use Q, you’ll need to accept that some users may not be able to distinguish your quotations from the surrounding text. Rather than compromising your markup with the solution given here, I would strongly suggest supporting IE/Win users with conditional comments, either adding the quotation marks directly into the text, or styling with italics, or adding punctuation with JS (or some combination thereof).

Having said all that, I like very much the idea of the Q element. My personal view is that since punctuation can alter the meaning of quoted material, semantic markup (Q, INS, DEL, BLOCKQUOTE) offers a chance to disambiguate quotation and interpolation. Traditional typography has often obscured this basic information. For example, whereas US English typically brings commas and full points following quotations within the quotation marks, British English typically only does so if that punctuation is present in the quoted material. As The Oxford Guide to Style (2002) comments: “While this does not vex Americans very much, the ambiguity can cause editorial problems when transforming American text and transposing closing punctuation.” It can become a tremendous hassle for scholars if quoted material is lost or otherwise unavailable.

This potential for Q and BLOCKQUOTE seems to have been lost on most advocates of quotation markup, including W3C’s own web accessibility WG, who included a citation inside a BLOCKQUOTE in a horrendous example of techniques for WCAG .

If you want to encourage the proper use of Q, I recommend you:

A) Do not add to the chaos by using the technique advanced by this article.

B) If you know how to make a user agent utilize the Q element, whether with configuration, a Jaws script, a LISP file, whatever, share that knowledge. For example, with Window-Eyes 5.5, select “Verbosity…” from the menu, then “Browse Mode”, then “Quotes / Block Quotes”. Tick “Insert Beginning / End Message”. Now Window-Eyes will announce the beginning and end of Q.

B) Encourage W3C to create a workable specification of Q and associated style properties for (X)HTML+CSS.

C) Help those who write developer documentation like MSDN to describe the Q element correctly [microsoft.com].

D) Join the (free) Internet Explorer feedback program and vote for Feedback ID 56347 [link only works once signed in]: “Q elements don’t insert quote marks (determined by CSS/language)”. The IE team have not ruled out fixing this behavior in the next release after IE7.

F) Design XSLT, CSS, or JavaScript algorithms to punctuate Q correctly according to the complicated typographical rules propounded by guides like the Chicago Manual of Style, and make them available to the world (note: once you limit the content of Q to content that was actually in the source material, this task becomes rather complicated).

G) Encourage Freedom Scientific and other screen reader developers to provide support for Q, and better yet make such support default behavior.

H) Work on improving the default rendering of Q so that it is sensitive to nesting and language, as per the W3C specifications, in Firefox (Mozilla Bugzilla 354356 ), Lynx, ELinks, Opera, WebKit, KHTML, and {insert your favorite browser here}.

I) Work on fixing other browser bugs, like the failure to copy to clipboard generated content as mentioned by Justin Greer . There may be similar issues with the GoogleBot, but I haven’t looked into that.

J) More contentiously, don’t pollute the semantics of Q and BLOCKQUOTE by including material that was not originally part of the source. If you need to do so, I suggest using INS or DEL.

Just to pick up a couple loose ends:

Natalie Jost :

I’ve read that things are moving toward quote instead of q, is that right? I’ve been using quote partly for that reason and partly because I prefer to control quotation marks myself. It seems like that’s akin to a period, comma, or other punctuation and I hate to let a browser decide if/when/how it wants to display punctuation – which is essentially content, right?”

AFAIK “quote” is invalid (X)HTML; and even the current XHTML 2 draft uses “q” not “quote”. I seem to remember there was a brief period when XHTML 2 did call it “quote”; perhaps that is what you are thinking of.

Jim Dalton :

[B]rowsers will not render quotation marks by default in XHTML2. So the solution that Stacey provides here is in fact perfect, since it encourages us all to start coding quotes correctly now.

I strongly disagree. You’re coding HTML 4.01 or XHTML 1.x, and you’re coding it wrong. Nothing that ever happens with XHTML 2 will ever make up your markup correct.

posted at 11:20 pm on September 26, 2006 by Benjamin Hawkes-Lewis

33 JS Behaviors?

Why not use conditional comments and IE Javascript Behaviors to alter how q elements are rendered?

posted at 11:41 pm on September 26, 2006 by Josh Peters

34 Generated content in IE

One possible issue with the author’s solution is if IE supports the :before/:after pseudo elements before providing support for Q, or vice-versa, one would have to go back to re-address the matter on X-number of sites.

I don’t know that it would be a problem if it’s that way round. If IE7 does support generated content on :before and :after, then it will simply add nothing at the beginning of <q> and nothing at the end, so it won’t make any difference.

The other way round would be a problem, inasmuch as it would result in double quotes appearing. I can’t think of an easy solution to that, other than doing some serious damage to Redmond!

posted at 11:53 pm on September 26, 2006 by Stephen Down

35 No quote support in IE 7

> “IE7 doesn’t support the q tag either”

Whoops, my bad. Sorry, and thanks to Chris for the correction.

I’d personally still use JavaScript for IE 7 and below (as my fuzzy memory is telling me IE 7 doesn’t support generated content).

posted at 12:02 am on September 27, 2006 by Paul Waite

36 Re: Q Tag

What do you mean, the “q” start tag, or the “q” end tag? Seriously, what about correct terminology. Guess you wanted to talk about the “q” element.

(Saying it this way because just recently, many – including me – once again pointed out the difference between elements and tags.)

posted at 12:10 am on September 27, 2006 by Jens Meiert

37

What do you mean, the “q� start tag, or the “q� end tag? Seriously, what about correct terminology. Guess you wanted to talk about the “q� element.

It is indeed an element. We know that. You know that. We decided to leave it “q tag” because we usually go for conversational style unless it causes confusion. I tend to think that anyone passionate about the q element isn’t likely to be confused about it.

posted at 01:10 am on September 27, 2006 by Erin Kissane

38

Thank you, Mr. Hawkes-Lewis , for demonstrating how to comprehensively disagree with an author while keeping the discussion productive, informative, and civil. This kind of comment (and the lively debate going on all around it) is why we have forums. Hats off to you, sir!

I’m leaving the technique questions for Stacey to address, but I wanted to go back a page and respond to one point :

I’m sure there are some good reasons, probably involving accessibility, to use <q> tags, but this article doesn’t provide any of them, which leaves me wondering why anyone would ever use the technique described in it. Next time Stacey, try explaining what your technique actually achieves before describing how to implement it.

You’re reading an ALA article clearly geared toward semantics enthusiasts. The author states that she’s trying to improve semantic soundness. If you don’t know why semantically sound markup is better than semantically unsound markup, your time might be better spent reading the oodles of articles and books that could inform you rather than, for instance, chiding the author for not explaining the basics.

posted at 01:41 am on September 27, 2006 by Erin Kissane

39 Regarding #22 and #36

I think it’s worth noting that if you copy and paste text from a page that uses Q (by itself), no quotes are inserted into the copied text. That makes the Q tag somewhat useless in a semantic regard. (Tested in Firefox and Safari.)

Actually, it worked fine copying from Safari and pasting into a TextEdit document. In fact, it corrected the double-hash marks to a true open and close quote.

What do you mean, the “q� start tag, or the “q� end tag? Seriously, what about correct terminology. Guess you wanted to talk about the “q� element.

Actually, it is the q start tag and q end tag. The tags plus the contents, collectively are the q element. Syntactically, that was correct. See this

posted at 01:58 am on September 27, 2006 by John Lascurettes

40 RE my RE

Oops. I see Jens original point. The article title was “The Q Tag” and that was syntactically incorrect. Based on his comment, I took what he was obtusely saying as a literal quote from the article. My bad.

posted at 02:29 am on September 27, 2006 by John Lascurettes

Pages

« First  <  2 3 4 5 6 >  Last »

Discussion Closed

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

Got something to say?

Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.

Create a new account or sign in below if you’d like to leave a comment.

Remember me

Forgot your password?

Subscribe to this article's comments: RSS (what’s this?)