You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
modify HTML boolean attributes, e.g. replace selected with selected="selected" or selected=""
add self-closing slash for void elements. e.g. replace <br> with <br/>
JavaScript changes to avoid potential bugs:
Check element.tagName, element.nodeName with caution since they may be in uppercase for HTML5 but in lowercase for XHTML5
Tell XHTML5 mode by checking document.contentType === 'application/xhtml+xml'
To debug and locate syntax error reason when setting element.innerHTML, use try...catch and log the html to-be-set
Known locations to be changed:
eruda/src/Info/defInfo.js:51
replace }&exclude=true"></a> with }&exclude=true" /></a>
luna/src/setting/index.ts:449
insert .join('') for map() return value
luna/src/setting/index.ts:596
replace ' selected' with ' selected="selected"'
luna/src/setting/index.ts
optionally, replace all ></input> with />
XHTML5 Compliance Test page
test.xhtml
<!DOCTYPE html><htmlxmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>XHTML5 Compliance Test</title></head><body><pid="message">This is an XHTML5 document</p><script>document.querySelector('#message').textContent+=' served with MIME '+document.contentType;// if (navigator.userAgent.includes('Mobile') || !('onmousedown' in window)){letscript=Object.assign(document.createElement('script'),{onload: ()=>{/* global eruda */eruda.init({container: document.body.appendChild(document.createElement('div')),tool: ['console','info']});console.log('initialized eruda');},async: false,src: '../dist/eruda.js'});document.body.append(script);}</script></body></html>
The text was updated successfully, but these errors were encountered:
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: