User blog comment:Ohmyn0/Making your wiki HTML5 compliant/@comment-3147293-20120711023117/@comment-2200849-20120711150630

More likely than not $wgCleanupPresentationalAttributes and/or $wgValidateAllHtml is false. The first one would try and replace it with valid code, while the second would not let the page load if it's nonconformant.