diff options
author | Matt Farina <[email protected]> | 2013-05-06 19:53:16 -0400 |
---|---|---|
committer | Matt Farina <[email protected]> | 2013-05-06 19:53:16 -0400 |
commit | cb6da5768688773ed56c0b05f27c8529b6dc34c8 (patch) | |
tree | 5ad4205e6990932efcc8987f16c8f083a999b154 /test | |
parent | 8e36445d25667ead6f2f40bbcee97102c489cd38 (diff) |
Updated the TEXT_RAW tags to be those specified and those that should act like it.
References to the html5 sections included.
Note, the pre tag was removed from being treated as raw text. It can often have
children (e.g., the code tag) and is specific for display time. Makes me wonder
why pre is it's own tag if it's for display. Why not just use styles?
Diffstat (limited to 'test')
-rw-r--r-- | test/HTML5/Parser/TokenizerTest.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/HTML5/Parser/TokenizerTest.php b/test/HTML5/Parser/TokenizerTest.php index 7ec4c76..10f9f9a 100644 --- a/test/HTML5/Parser/TokenizerTest.php +++ b/test/HTML5/Parser/TokenizerTest.php @@ -389,30 +389,30 @@ class TokenizerTest extends \HTML5\Tests\TestCase { public function testRawText() { $good = array( - '<pre>abcd efg hijk lmnop</pre> ' => 'abcd efg hijk lmnop', - '<pre><not/><the/><tag></pre>' => '<not/><the/><tag>', - '<pre><<<<<<<<</pre>' => '<<<<<<<<', - '<pre>hello</pre</pre>' => 'hello</pre', - "<pre>\nhello</pre\n</pre>" => "\nhello</pre\n", - '<pre>&</pre>' => '&', - '<pre><!--not a comment--></pre>' => '<!--not a comment-->', - '<pre><![CDATA[not a comment]]></pre>' => '<![CDATA[not a comment]]>', + '<script>abcd efg hijk lmnop</script> ' => 'abcd efg hijk lmnop', + '<script><not/><the/><tag></script>' => '<not/><the/><tag>', + '<script><<<<<<<<</script>' => '<<<<<<<<', + '<script>hello</script</script>' => 'hello</script', + "<script>\nhello</script\n</script>" => "\nhello</script\n", + '<script>&</script>' => '&', + '<script><!--not a comment--></script>' => '<!--not a comment-->', + '<script><![CDATA[not a comment]]></script>' => '<![CDATA[not a comment]]>', ); foreach ($good as $test => $expects) { $events = $this->parse($test); - $this->assertEventEquals('startTag', 'pre', $events->get(0)); + $this->assertEventEquals('startTag', 'script', $events->get(0)); $this->assertEventEquals('text', $expects, $events->get(1)); - $this->assertEventEquals('endTag', 'pre', $events->get(2)); + $this->assertEventEquals('endTag', 'script', $events->get(2)); } $bad = array( - '<pre>&</pre' => '&</pre', - '<pre>Hello world' => 'Hello world', + '<script>&</script' => '&</script', + '<script>Hello world' => 'Hello world', ); foreach ($bad as $test => $expects) { $events = $this->parse($test); $this->assertEquals(4, $events->depth(), "Counting events for '$test': " . print_r($events, TRUE)); - $this->assertEventEquals('startTag', 'pre', $events->get(0)); + $this->assertEventEquals('startTag', 'script', $events->get(0)); $this->assertEventError($events->get(1)); $this->assertEventEquals('text', $expects, $events->get(2)); } |