Make the Token class abstract.
[htmlpurifier.git] / library / HTMLPurifier / Token / Text.php
blob75d25e3f85b5ef2dcec43ae3461eca4cf8fdbf9c
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 /**
16 * @type string
18 public $name = '#PCDATA';
19 /**< PCDATA tag name compatible with DTD. */
21 /**
22 * @type string
24 public $data;
25 /**< Parsed character data of text. */
27 /**
28 * @type bool
30 public $is_whitespace;
32 /**< Bool indicating if node is whitespace. */
34 /**
35 * Constructor, accepts data and determines if it is whitespace.
36 * @param string $data String parsed character data.
37 * @param int $line
38 * @param int $col
40 public function __construct($data, $line = null, $col = null)
42 $this->data = $data;
43 $this->is_whitespace = ctype_space($data);
44 $this->line = $line;
45 $this->col = $col;
49 // vim: et sw=4 sts=4