diff options
-rw-r--r-- | src/HTML5/Serializer/Traverser.php | 6 | ||||
-rw-r--r-- | test/HTML5/Serializer/TraverserTest.php | 20 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/HTML5/Serializer/Traverser.php b/src/HTML5/Serializer/Traverser.php index 097162e..be485f4 100644 --- a/src/HTML5/Serializer/Traverser.php +++ b/src/HTML5/Serializer/Traverser.php @@ -166,6 +166,12 @@ class Traverser { } } + /** + * Write a text node. + * + * @param \DOMText $ele + * The text node to write. + */ protected function text($ele) { if ($this->isLiteral($ele)) { $this->wr($ele->wholeText); diff --git a/test/HTML5/Serializer/TraverserTest.php b/test/HTML5/Serializer/TraverserTest.php index 32f7dec..fef5135 100644 --- a/test/HTML5/Serializer/TraverserTest.php +++ b/test/HTML5/Serializer/TraverserTest.php @@ -82,4 +82,24 @@ class TraverserTest extends \HTML5\Tests\TestCase { $m->invoke($t, 'foo'); $this->assertEquals('foo', stream_get_contents($s, -1, 0)); } + + function testText() { + // $dom = new \DOMDocument(); + // $dom->loadHTML('<!doctype html> + // <html lang="en"> + // <head> + // <meta charset="utf-8"> + // <title>Test</title> + // </head> + // <body> + // <textarea>baz()</textarea> + // </body> + // </html>'); + // //var_export($dom); + // print_r($dom); + // $list = $dom->getElementsByTagName('textarea'); + // print_r($list->item(0)); + //print_r($dom->get()); + + } }
\ No newline at end of file |