Closed nhoizey closed 4 years ago
this looks like expected, as document.documentElement
is already the <html>
tag by standards.
You are injecting an <html>
tag within an <html>
node, so what you call a regression, is actually a logical fix to me, hence I don't think I should do anything in here.
Ok, I can understand it's a fix instead of a regression.
Would you have any advice to clean the html
string before document.documentElement.innerHTML = html;
, or use anything else than document.documentElement.innerHTML =…
?
Don't you ever use BasicHTML on full documents?
Thanks
maybe this?
document.documentElement.innerHTML = html.replace(/^[\S\s]*?<html[\S\s]*?>([\S\s]*?)<\/html>/i, '$1');
@WebReflection I will check this, thanks a lot! 🙏
alternative solution in here: https://github.com/nhoizey/images-responsiver/issues/72#issuecomment-684764424
@WebReflection hi Andrea, sorry to bother you here once again.
I still can't find how to use Sizzle with the code you provided in https://github.com/nhoizey/images-responsiver/issues/72#issuecomment-686762982
Thanks for your help! 🙏
@nhoizey yeah, that part is a bit of a shenanigan ... but for the time being, you can try this solution, I hope it works.
I'm loading full HTML documents in BasicHTML, with DOCTYPE and
<html>
, and it used to work properly up to v2.2.9Now, in v2.3.0,
document.toString()
gives me a duplicate<html><html>…</html></html>
.Sample script:
Outputs this in v2.2.9:
<!DOCTYPE html><html><body><p>Hello</p></body></html>
Outputs this in v2.3.0:
<!DOCTYPE html><html><html><body><p>Hello</p></body></html></html>