- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Fri, 1 Dec 2017 17:23:34 -0800
- To: Martin J. Dürst <duerst@it.aoyama.ac.jp>
- Cc: "Liam R. E. Quin" <liam@w3.org>, Matt King <a11ythinker@gmail.com>, "spec-prod@w3.org Prod" <spec-prod@w3.org>
On Sun, Nov 19, 2017 at 12:19 AM, Martin J. Dürst <duerst@it.aoyama.ac.jp> wrote: > On 2017/11/19 16:28, Liam R. E. Quin wrote: >> On Sat, 2017-11-18 at 22:26 -0800, Matt King wrote: >>> Is there a good reason to use " instead of " when writing code >>> samples in our specs? >> >> None that i'm aware of. You need & and < though. > > If there's one, then it's probably "No need to have to think about whether > I'm in an attribute, or in content." That can come in handy in programs, or > when you expect a lot of copying of content from attribute values to content > and back. Right. All you need, to be precise, is: 1. In text, escape & and <. 2. In a quoted attribute value, escape & and whatever character you use for quoting (either ' or "). (Unquoted attribute values have more complex rules, only use them if you have simple values.) But it's safe to escape all four at all times if you don't want to have to think about it. (People often escape > as well for some reason. It's always safe to use unquoted, tho.) ~TJ
Received on Saturday, 2 December 2017 01:24:19 UTC