Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View Report does not work on page that are served with MIME type 'application/xhtml+xml' #53

Closed
RaphDeRooij opened this issue Oct 18, 2012 · 1 comment

Comments

@RaphDeRooij
Copy link

On page that are served with MIME type 'application/xhtml+xml', the 'View Report' link doesn't work. Tested with Firefox 16.0.1 and URI http://www.opvallendeplanten.nl/
When IE8 is used, the same page is served with MIME type 'text/html'. In that case, the 'View Report' link does work.

PS:
In Firefox, HTML_CodeSniffer reports 6 errors, 33 warnings and 72 notices.
In IE8, HTML_CodeSniffer reports 7 errors, 34 warnings and 69 notices.
The only difference is the MIME type, not the HTML code.
Problem: I can't compare the reports.

@luketw
Copy link
Member

luketw commented Oct 18, 2012

Thank you for your reports.

The main part of the issue seems to relate to a " " entity placed in the gap in the "X Errors, Y Warnings" message on the issue list. When parsed as XHTML instead of XML, entities like nbsp don't exist, so the browser is throwing a DOM processing error. This can probably be fixed by changing it to " " instead, and I'll look at getting it fixed in the next release.

The differences between IE8 and IE9/Firefox/Chrome may be due to the different methods of processing the document into the DOM compared with newer browsers. Certainly if it is sent and parsed as XHTML, there is no room for browser interpretation on parsing, unlike plain HTML.

In Chrome, Firefox and IE9 I get 6/33/72 (errors/warnings/notices) in each, IE8 I get slightly different. Unfortunately this is not something that can easily be worked around, since HTMLCS works on the DOM, not on the source code.

luketw pushed a commit to luketw/HTML_CodeSniffer that referenced this issue Oct 26, 2012
…es parsed as XHTML.

Same thing, but XHTML (based on XML) does not have the automatic definition for nbsp like HTML, so was throwing syntax errors in XML parsing.
This occured when there was more than one type of error shown in the issue list (eg. "5 errors, 30 warnings").
Fixes GitHub issue squizlabs#53.
luketw pushed a commit that referenced this issue Oct 26, 2012
@luketw luketw closed this as completed Jan 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants