diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2014-02-21 15:43:14 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2014-02-21 15:43:14 +0100 |
commit | d4949327efa15b492cab1bef3fe074290a328a17 (patch) | |
tree | e89e0322bb1f1b06d663fd10fdded21bac867e5d /inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Text.php | |
parent | c9bd17a1007bb78e5de0775efca01df0fb515031 (diff) | |
download | wallabag-d4949327efa15b492cab1bef3fe074290a328a17.tar.gz wallabag-d4949327efa15b492cab1bef3fe074290a328a17.tar.zst wallabag-d4949327efa15b492cab1bef3fe074290a328a17.zip |
[add] HTML Purifier added to clean code
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Text.php')
-rw-r--r-- | inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Text.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Text.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Text.php new file mode 100644 index 00000000..f51d861a --- /dev/null +++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Text.php | |||
@@ -0,0 +1,54 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Concrete text token class. | ||
5 | * | ||
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. | ||
11 | */ | ||
12 | class HTMLPurifier_Node_Text extends HTMLPurifier_Node | ||
13 | { | ||
14 | |||
15 | /** | ||
16 | * PCDATA tag name compatible with DTD, see | ||
17 | * HTMLPurifier_ChildDef_Custom for details. | ||
18 | * @type string | ||
19 | */ | ||
20 | public $name = '#PCDATA'; | ||
21 | |||
22 | /** | ||
23 | * @type string | ||
24 | */ | ||
25 | public $data; | ||
26 | /**< Parsed character data of text. */ | ||
27 | |||
28 | /** | ||
29 | * @type bool | ||
30 | */ | ||
31 | public $is_whitespace; | ||
32 | |||
33 | /**< Bool indicating if node is whitespace. */ | ||
34 | |||
35 | /** | ||
36 | * Constructor, accepts data and determines if it is whitespace. | ||
37 | * @param string $data String parsed character data. | ||
38 | * @param int $line | ||
39 | * @param int $col | ||
40 | */ | ||
41 | public function __construct($data, $is_whitespace, $line = null, $col = null) | ||
42 | { | ||
43 | $this->data = $data; | ||
44 | $this->is_whitespace = $is_whitespace; | ||
45 | $this->line = $line; | ||
46 | $this->col = $col; | ||
47 | } | ||
48 | |||
49 | public function toTokenPair() { | ||
50 | return array(new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null); | ||
51 | } | ||
52 | } | ||
53 | |||
54 | // vim: et sw=4 sts=4 | ||