[wp-trac] [WordPress Trac] #14225: Use NCRs instead of HTML entities in Twenty Ten

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 31 08:47:20 UTC 2010


#14225: Use NCRs instead of HTML entities in Twenty Ten
-----------------------------------+-----------------------------
 Reporter:  peaceablewhale         |       Owner:
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Future Release
Component:  Themes                 |     Version:  3.0
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+-----------------------------

Comment (by GaryJ):

 To correct myself:
 In HTML5, parsed as `text/html`, all named entities are predefined and
 valid.

 However, like XHTML 1.0 Strict MAY be (and usually is) parsed as
 `text/html` and not `application/xhtml+xml`, it's possible to write HTML5
 in a polyglot form, such that should it be parsed with an XML parser (as
 `application/xhtml+xml`) it would be valid XHTML5.

 There is no formal DTD for XHTML5, and although you could provide
 reference to an external DTD for adding named entities, browsers do not
 universally make use of them for their parsers, meaning it's basically not
 an option, as, say, `·`, `…` or `»` may not be
 recognised.

 The recommendation by the WHATWG for producing HTML5 documents capable of
 being parsed as XML for XHTML5, is to use numerical entities, except for
 the 5 implicit named entities that are safe.

 Changing all named entities to their hexadecimal equivalents across all of
 core, not just Twenty Ten, has no negative impacts (save .po strings
 changing), as browsers back to at least IE5.5 (and maybe earlier) cope
 with hexadecimal characters fine. In the meantime, it's a future-proofing
 fix that will greatly aid those wanting to output their sites as
 `application/xhtml+xml`, without having to raise individual issues such as
 #16049!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14225#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list