diff options
author | Christian A. Weber | 2018-04-23 15:41:46 +0200 |
---|---|---|
committer | Christian A. Weber | 2018-04-23 15:41:46 +0200 |
commit | 930db3b36d87cd084e918f5cce6bc8f5760663ca (patch) | |
tree | 67b59d60a3beb00c02850d71b7c7fe39c57751da /tests/it_html.t | |
parent | 6ed5d50f5bd4ccc4d78dfdc47f3b95d4bdc20af3 (diff) | |
download | itools-930db3b36d87cd084e918f5cce6bc8f5760663ca.tar.gz itools-930db3b36d87cd084e918f5cce6bc8f5760663ca.tar.bz2 itools-930db3b36d87cd084e918f5cce6bc8f5760663ca.zip |
officially support htmltype => 'xml', don't short-close voidtags in xhtml mode
Diffstat (limited to 'tests/it_html.t')
-rwxr-xr-x | tests/it_html.t | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/it_html.t b/tests/it_html.t index 0c419b8..bcfd40d 100755 --- a/tests/it_html.t +++ b/tests/it_html.t @@ -108,9 +108,26 @@ foreach (array('html5' => "<br flag>", 'html' => "<br flag>", 'xhtml' => "<br fl is (trim(br(array('flag' => true))), $value, "Check empty tag and attribute for $type"); } +# XHTML generation +unset($GLOBALS['it_html']); +new it_html(array('htmltype' => "xhtml", 'tags' => "script")); + +is( + script(), + "<script></script>\n", + "script may not be shortened (see xhtml spec)" +); + +is( + h1(), + "<h1></h1>\n", + "empty h1 tag in xhtml context" +); + + # XML generation unset($GLOBALS['it_html']); -new it_html(array('htmltype' => "xhtml", 'tags' => "xmltest")); +new it_html(array('htmltype' => "xml", 'tags' => "xmltest")); is( xmltest(), @@ -121,7 +138,7 @@ is( is( xmltest("foo"), "<xmltest>foo</xmltest>\n", - "empty xmltest tag" + "non-empty xmltest tag" ); is( |