kraih/mojo — pull request #602 by jamadam (2014-03-07 05:01:35+00:00)
Title: make dom rendering more compatible

Mojo::DOM::HTML minimizes empty script tag at rendering phase.

my $dom = Mojo::DOM->new('');
$dom->xml(1);
warn $dom; #

The resulted HTML isn't parsed as expected by Firefox and Chrome with content
type text/html.

W3C's compatibility guideline says as follows.

http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict

> Given an empty instance of an element whose content model is not EMPTY
> (for example, an empty title or paragraph) do not use the minimized form
> (e.g. use

and not

).

EMPTY tag names are already listed in Mojo::DOM::HTML as %EMPTY
so it may be better not to minimize none EMPTY tags.