htmldoctypexhtml-1.0-strict

!DOCTYPE html destroyed page


I have strange bug with !DOCTYPE html.

When I'm trying to use HTML5 Doctype, then my page looks weird. All scripts looks like not closed properly.

But when I'm changing to !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", then everything looks good.

I don't understand what's wrong with page structure and why it's happened only with HTML5.


Solution

  • Thank you guys, for your help!

    I found how I can solve it. In my case, error was in one extension, which used $dom->saveXML() method in observer. And before rendering this method parsed DOM and removed/replaced HTML output.