WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 months ago

#14224 closed defect (bug) (worksforme)

Use NCR instead of HTML entity in feed autodiscovery links

Reported by: peaceablewhale Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Feeds Keywords: has-patch 2nd-opinion
Focuses: template Cc:

Description

Currently, » is used as the separator. This will break sites served with the internet media type "application/xhtml+xml". The equivalent numeric character reference » should be used instead.

Attachments (2)

14224.patch (1.0 KB) - added by peaceablewhale 4 years ago.
14224-ent2ncr.patch (1.1 KB) - added by peaceablewhale 4 years ago.

Download all attachments as: .zip

Change History (11)

peaceablewhale4 years ago

comment:1 westi4 years ago

Why does this break the page when serving as XHTML?

AFAIK XHTML supports the same named entities as HTML4 which would inclide &raquo'.

http://www.w3.org/TR/html401/sgml/entities.html

Changing this makes it less clear what it being done.

comment:2 nacin4 years ago

application/xhtml+xml != XHTML. See also #14225, #14226.

comment:3 westi4 years ago

In general we don't code for serving as application/xhtml+xml but rather as text/html

As far as entities are concerned the named entities are fine in XML as long as the parser used can cope with them:

http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML

comment:4 peaceablewhale4 years ago

@westi:
The XHTML 1.x specification did adopt all entities from HTML 4 and place them in the DTDs. However, browsers and most XML processors currently do not load DTD (at least by default) and therefore the entity references cannot be loaded properly and fatal error occurs.

In addition, HTML 5 does not provide a DTD nor require browsers to load a DTD. The HTML/XHTML Compatibility Authoring Guidelines stated that no entity reference is used.

@nacin:
A XHTML document should be served as application/xhtml+xml. By doing so, SVG and MathML can be embedded to the XHTML document inline. Internet Explorer 9 has support to application/xhtml+xml.

comment:5 peaceablewhale4 years ago

If using NRC directly makes the code less clear, ent2ncr() may be used for the conversion.

comment:6 nacin3 years ago

  • Milestone changed from Awaiting Review to Future Release

comment:7 nacin3 years ago

  • Keywords 2nd-opinion added

comment:8 holizz3 years ago

  • Cc tom@… added

comment:9 nacin3 months ago

  • Component changed from Template to Feeds
  • Focuses template added
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Do we still care about this? Please re-open if so.

Note: See TracTickets for help on using tickets.