From cb6da5768688773ed56c0b05f27c8529b6dc34c8 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Mon, 6 May 2013 19:53:16 -0400 Subject: 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? --- src/HTML5/Elements.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/HTML5') diff --git a/src/HTML5/Elements.php b/src/HTML5/Elements.php index 99cd6a3..51784a7 100644 --- a/src/HTML5/Elements.php +++ b/src/HTML5/Elements.php @@ -11,8 +11,15 @@ namespace HTML5; class Elements { const KNOWN_ELEMENT = 1; + + // From section 8.1.2: "script", "style" + // From 8.2.5.4.7 ("in body" insertion mode): "noembed", "noscript" + // From 8.4 "style", "xmp", "iframe", "noembed", "noframes" const TEXT_RAW = 2; + + // From section 8.1.2: "textarea", "title" const TEXT_RCDATA = 4; + const VOID_TAG = 8; // "address", "article", "aside", "blockquote", "center", "details", "dialog", "dir", "div", "dl", @@ -110,7 +117,7 @@ class Elements { "output" => 65, // NORMAL | BLOCK_TAG "p" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG "param" => 9, // NORMAL | VOID_TAG - "pre" => 83, // NORMAL | TEXT_RAW | AUTOCLOSE_P | BLOCK_TAG + "pre" => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG "progress" => 1, "q" => 1, "rp" => 1, @@ -157,7 +164,7 @@ class Elements { 'applet' => 0, 'marquee' => 0, 'isindex' => 8, // VOID_TAG - 'xmp' => 18, // AUTOCLOSE_P | VOID_TAG + 'xmp' => 20, // AUTOCLOSE_P | VOID_TAG | RAW_TEXT 'noembed' => 2, // RAW_TEXT ); @@ -289,7 +296,7 @@ class Elements { "polyline" => 1, "radialGradient" => 1, "rect" => 1, - "script" => 1, + "script" => 3, // NORMAL | RAW_TEXT "set" => 1, "stop" => 1, "style" => 3, // NORMAL | RAW_TEXT -- cgit v1.2.3