flak rss random

the trouble with q quotes

Among the underutilized HTML elements is the q tag, for quotes. This should, depending on user agent, render with appropriate opening and closing quote marks, without needing to specify them by hand. This sounds really convenient, to avoid ambiguity when quotes are nested inside quotes inside quotes. I said, “Alex told Bobby, “according to Chris, “Danny said “No way am I the one who’s confused,” when asked,” direct quote,” yesterday morning,” emphatically. Lucky Danny.

The browser might even somewhat intelligently choose pairs of quotes that alternate with each nesting. In practice, I’ve found they mostly pick double quotes for the outside, then single quotes for all inner quotes. Fortunately, we can add a custom style that defines a larger vocabulary of quote marks.

I said, Alex told Bobby, according to Chris, Danny said No way am I the one who's confused, when asked, direct quote, yesterday morning, emphatically. I personally despise the archaic fake fancy ASCII double quotes, but nevertheless useful for demonstration purposes.

Another cool trick is that the quotes can be auto selected by language. For example, I might quote Le 24 février 1815, la vigie de Notre-Dame de la Garde signala le trois-mâts le Pharaon, venant de Smyrne, Trieste et Naples. in French, but it will be quoted as On the 24th of February, 1815, the look-out at Notre-Dame de la Garde signalled the three-master, the Pharaon from Smyrna, Trieste, and Naples. in English. Alas, this only works if the stylesheet leaves the default untouched or specifies auto, necessitating the second style with the span selector above.

But now comes a more serious problem. Pseudo element content is, per standard, not selectable. Not copyable. So if I highlight my quotable quotes sentence, copy it, and paste it into another application, I get varying results.

Edge and Safari copy the sentence without any quote marks at all: I said, Alex told Bobby, according to Chris, Danny said No way am I the one who’s confused, when asked, direct quote, yesterday morning, emphatically. Most confusing.

Firefox inserts double quotes for the q elements: I said, “Alex told Bobby, “according to Chris, “Danny said “No way am I the one who’s confused,” when asked,” direct quote,” yesterday morning,” emphatically. I’m not sure if that’s to spec or not, but it’s certainly more helpful. (flak makes them look pretty; the copied text contains plain straight quotes.)

Lynx does not support CSS, so the French quotes are less French, but it does intelligently alternate between double and single quotes for deeply nested tags. I said, “Alex told Bobby, ‘according to Chris, “Danny said ‘No way am I the one who’s confused,’ when asked,” direct quote,’ yesterday morning,” emphatically. Was that so hard?

I lack the web wizardry skills to fix this in a reliable fashion. I guess you’d have to insert invisible elements containing the quote characters you want copied, but I think at that point just give up and don’t even use the q element.

By default, the blockquote element does not feature such decoration, although I’ve found it nice to add. Here, the inability to select and copy the quote marks is much less troublesome, maybe even desirable.

The year 1866 was marked by a bizarre development, an unexplained and downright inexplicable phenomenon that surely no one has forgotten. Without getting into those rumors that upset civilians in the seaports and deranged the public mind even far inland, it must be said that professional seamen were especially alarmed. Traders, shipowners, captains of vessels, skippers, and master mariners from Europe and America, naval officers from every country, and at their heels the various national governments on these two continents, were all extremely disturbed by the business.

Posted 24 May 2022 14:21 by tedu Updated: 24 May 2022 14:21
Tagged: web