w3c / hlreq

Hebrew script layout requirements
Other
8 stars 9 forks source link

q element produces incorrect quotation marks when language changes #18

Open r12a opened 4 years ago

r12a commented 4 years ago

This issue is common across all languages that use the q element and use different quote marks than English.

When an English page contains a quotation in another language, the quotation marks used around that quotation (and inside it for embedded quotes) should be the English ones – not those of the language of the quotation. The same applies for other languages.

Currently, if the language of the quotation is declared on the q tag in HTML and that tag has a lang attribute, browsers instead set the quotation marks based on the language of the quote.

For example, quotations work fine in a sentence that is all in the same language. In this example the markup:

<span lang="he">אחת <q>שתיים <q>שלוש</q></q></span>

will produce the expected result:

אחת ”שתיים ’שלוש’”

However, if the quote is in English and lang="en" is added to the first q tag, the result becomes:

אחת “two ‘three’

whereas it should be:

אחת ”two ’three’

Specs: This incorrect behaviour was initially introduced by the HTML specification. issue 3636 was raised to change the spec. In the end the entire section was removed from the HTML spec, and HTML now relies on CSS for this behaviour.

css-content says that If a quotation is in a different language than the surrounding text, it is customary to quote the text with the quote marks of the language of the surrounding text, not the language of the quotation itself., however it is non-normative text.

Issue 5478 Open, requests that this be made normative, and has been agreed by the CSS WG.

Tests & results: Interactive test, When an embedded quote is in a different language, the quotation marks should be those of the main body, even if the language of the quote is declared using a lang attribute.
Gecko, Blink, and Webkit fail. The quotation marks are those associated with the quotation rather than those associated with the surrounding text.

i18n test suite, Multilingual nesting.

Priority: Marking this as advanced because it's possible, though not always as convenient, to use Unicode characters instead of the q element.

r12a commented 4 years ago

The first comment in this issue contains text that will automatically appear in the Hebrew gap-analysis document as a subsection with the same title as this issue. Any edits made to that comment will be immediately available in the document. Proposals for changes or discussion of the content can be made in comments below this point.