-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
XHTML5 compliance #428
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
XHTML5 is a common set of XHTML and HTML5, it should be declared with XHTML namespace (xmlns="http://www.w3.org/1999/xhtml"), served with XHTML mime type ("application/xhtml+xml") or opened with ".xhtml" filename extension.
HTML changes to ensure XHTML5 compliance:
selected
withselected="selected"
orselected=""
&
in attribute value as&
, avoid use of HTML-specific named entities like
©
<br>
with<br/>
JavaScript changes to avoid potential bugs:
element.tagName
,element.nodeName
with caution since they may be in uppercase for HTML5 but in lowercase for XHTML5document.contentType === 'application/xhtml+xml'
element.innerHTML
, use try...catch and log the html to-be-setKnown locations to be changed:
replace
}&exclude=true"></a>
with}&exclude=true" /></a>
insert
.join('')
for map() return valuereplace
' selected'
with' selected="selected"'
optionally, replace all
></input>
with/>
XHTML5 Compliance Test page
test.xhtml
The text was updated successfully, but these errors were encountered: