W3C home > Mailing lists > Public > public-html@w3.org > June 2013

Re: During HTML parsing, are *all* named character references replaced by their corresponding glyph?

From: Michael[tm] Smith <mike@w3.org>
Date: Mon, 24 Jun 2013 15:04:48 +0900
To: Šime Vidas <sime.vidas@gmail.com>
Cc: public-html@w3.org
Message-ID: <20130624060448.GA37377@sideshowbarker>
Šime Vidas <sime.vidas@gmail.com>, 2013-06-23 00:09 +0200:

> From what I understand, named character references, e.g. &amp;, only exist
> in HTML source code, and once the source code is parsed into the DOM, *all*
> named character entities are replaced by their corresponding glyphs. There
> is no exception to this rule.

The <script> and <style> elements are exceptions

> For instance, this source code:
> 
> <span>&amp;</span>
> 
> will produce a DOM element (of type "span") which contains a single Text
> node which then in turn contains the text value "&". So, not the entity
> &amp; but the actual "&" literal character.

True for all other elements but for <script>&amp;</script> and
<style>&amp;</style> the result's a text node containing the string "&amp;"

-- 
Michael[tm] Smith http://people.w3.org/mike
Received on Monday, 24 June 2013 06:05:00 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:33 UTC