]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/3rdparty/htmlpurifier/HTMLPurifier/Token/Text.php
remove autoload section in composer.json
[github/wallabag/wallabag.git] / inc / 3rdparty / htmlpurifier / HTMLPurifier / Token / Text.php
CommitLineData
d4949327
NL
1<?php\r
2\r
3/**\r
4 * Concrete text token class.\r
5 *\r
6 * Text tokens comprise of regular parsed character data (PCDATA) and raw\r
7 * character data (from the CDATA sections). Internally, their\r
8 * data is parsed with all entities expanded. Surprisingly, the text token\r
9 * does have a "tag name" called #PCDATA, which is how the DTD represents it\r
10 * in permissible child nodes.\r
11 */\r
12class HTMLPurifier_Token_Text extends HTMLPurifier_Token\r
13{\r
14\r
15 /**\r
16 * @type string\r
17 */\r
18 public $name = '#PCDATA';\r
19 /**< PCDATA tag name compatible with DTD. */\r
20\r
21 /**\r
22 * @type string\r
23 */\r
24 public $data;\r
25 /**< Parsed character data of text. */\r
26\r
27 /**\r
28 * @type bool\r
29 */\r
30 public $is_whitespace;\r
31\r
32 /**< Bool indicating if node is whitespace. */\r
33\r
34 /**\r
35 * Constructor, accepts data and determines if it is whitespace.\r
36 * @param string $data String parsed character data.\r
37 * @param int $line\r
38 * @param int $col\r
39 */\r
40 public function __construct($data, $line = null, $col = null)\r
41 {\r
42 $this->data = $data;\r
43 $this->is_whitespace = ctype_space($data);\r
44 $this->line = $line;\r
45 $this->col = $col;\r
46 }\r
47\r
48 public function toNode() {\r
49 return new HTMLPurifier_Node_Text($this->data, $this->is_whitespace, $this->line, $this->col);\r
50 }\r
51}\r
52\r
53// vim: et sw=4 sts=4\r