Make WordPress Core

Opened 15 years ago

Closed 14 years ago

Last modified 12 years ago

#13341 closed defect (bug) (maybelater)

XHTML named entities break XHTML document

Reported by: nicholaswilson's profile nicholaswilson Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9.2
Component: Template Keywords:
Focuses: Cc:

Description

The current output of Wordpress 2.9.2 is nearly standard XHTML, but breaks on my MathML pages served with +xml MIME type.

Fixes are trivial; please replace « and » entities in wp-includes/general-template.php with their numeric equivalents. Since the default theme's doctype is XHTML, you should be doing this anyway in the rare case someone has a correctly-configured server.

I am not trying to bring up the HTML/XHTML debate or say that you should not be trying to serve HTML-compatible XHTML; I am just asking these bugs be fixed so that those of us who do appreciate Wordpress' XHTML support can actually use it.

This bug breaks all pages on any Wordpress site served with XML MIME type and has been around for a while, so clearly none of the devs has ever tested any Wordpress output with an XML parser recently. May I suggest that in future this check is added to your testing for new releases to avoid causing 'yellow-screen-of-death' on upgrade for those of us who do need XML for MathML? Thanks.

Patch: trivial (as described). Can commit straight away unless internationalization of the strings causes problems.

Change History (8)

#1 @nicholaswilson
15 years ago

  • Cc nicholas@… added

#2 @nacin
15 years ago

Having not yet seen a patch, every » (40 matches including wp-admin) and « (31) I can find are in translatable strings and are thus accessible by filters and translations.

#3 @nicholaswilson
15 years ago

Yes; that is very lucky if you are foreign and your translation file fixes it, but the defaults should be changed so that it works out of the box with English.

Wordpress needs to be consistent and either produce HTML or produce HTML-compatible XHTML. Seeing as the latter has been chosen, it is required that there to be no DTD-declared entities. The core by default should output any for the output to be consistent, as an XHTML doctype at the very least indicates the document should be *able* to be served as XML (and more controversially as HTML with certain compatibility problems).

#4 @nicholaswilson
15 years ago

Further to the last, you really need to get your act together with validation and run a few sample pages through an XML parser to check. The file /wp-includes/comment-template.php produces fatal parse errors until   is replaced with  . Please commit this too.

#5 @nicholaswilson
15 years ago

Sorry for angry response, but when I enable commenting and a user posts a comment, I should not feel apprehensive that my pages become unviewable. I am sure you have read Mark Pilgrim's well-known post (http://diveintomark.org/archives/2004/01/14/thought_experiment), but this happened to me today and I was a little annoyed that the source of the error was right in the WP template itself. The conclusion of course is that WP is not suitable for pages with MathML, which is why I will have to eventually migrate (at least until FF4 is fully adopted) but in the meantime fixing these would be nice.

#6 @nacin
14 years ago

I don't think we'll ever be +xml out of the box.

#7 @nacin
14 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

#8 @Chase-san
12 years ago

This is a legitimate problem, more so considering chrome will be adding support for MathML in the next version (24), so the problem could very likely become more wide spread soon.

I suggest the MaybeLater be changed to MaybeSoon. :)

Note: See TracTickets for help on using tickets.