Mirror of XHTML regression fix from master