Make extractBody not terminate prematurely on first </body>.
[htmlpurifier.git] / library / HTMLPurifier / Token / Text.php
blob82efd823d6b60fd1be94f23159e0a4beb63b4953
1 <?php
3 /**
4 * Concrete text token class.
6 * Text tokens comprise of regular parsed character data (PCDATA) and raw
7 * character data (from the CDATA sections). Internally, their
8 * data is parsed with all entities expanded. Surprisingly, the text token
9 * does have a "tag name" called #PCDATA, which is how the DTD represents it
10 * in permissible child nodes.
12 class HTMLPurifier_Token_Text extends HTMLPurifier_Token
15 public $name = '#PCDATA'; /**< PCDATA tag name compatible with DTD. */
16 public $data; /**< Parsed character data of text. */
17 public $is_whitespace; /**< Bool indicating if node is whitespace. */
19 /**
20 * Constructor, accepts data and determines if it is whitespace.
22 * @param $data String parsed character data.
24 public function __construct($data, $line = null, $col = null) {
25 $this->data = $data;
26 $this->is_whitespace = ctype_space($data);
27 $this->line = $line;
28 $this->col = $col;
33 // vim: et sw=4 sts=4