aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2014-02-21 15:57:10 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2014-02-21 15:57:10 +0100
commit99679d06884120c57f43b44e55e03595f1f87bed (patch)
treea3f2a1aa1afdaeca1386d0c6e8a75344fd2241fb /inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php
parent655214ab30ee84884dc408488b85586f36263fcb (diff)
parentd3b47e94705e17b3ba3529cbb1dc6efe69c5d2b7 (diff)
downloadwallabag-99679d06884120c57f43b44e55e03595f1f87bed.tar.gz
wallabag-99679d06884120c57f43b44e55e03595f1f87bed.tar.zst
wallabag-99679d06884120c57f43b44e55e03595f1f87bed.zip
Merge pull request #481 from wallabag/dev1.5.2
1.5.2
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php')
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php
new file mode 100644
index 00000000..7db4d025
--- /dev/null
+++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php
@@ -0,0 +1,59 @@
1<?php
2
3/**
4 * Concrete element node class.
5 */
6class HTMLPurifier_Node_Element extends HTMLPurifier_Node
7{
8 /**
9 * The lower-case name of the tag, like 'a', 'b' or 'blockquote'.
10 *
11 * @note Strictly speaking, XML tags are case sensitive, so we shouldn't
12 * be lower-casing them, but these tokens cater to HTML tags, which are
13 * insensitive.
14 * @type string
15 */
16 public $name;
17
18 /**
19 * Associative array of the node's attributes.
20 * @type array
21 */
22 public $attr = array();
23
24 /**
25 * List of child elements.
26 * @type array
27 */
28 public $children = array();
29
30 /**
31 * Does this use the <a></a> form or the </a> form, i.e.
32 * is it a pair of start/end tokens or an empty token.
33 * @bool
34 */
35 public $empty = false;
36
37 public $endCol = null, $endLine = null, $endArmor = array();
38
39 public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) {
40 $this->name = $name;
41 $this->attr = $attr;
42 $this->line = $line;
43 $this->col = $col;
44 $this->armor = $armor;
45 }
46
47 public function toTokenPair() {
48 // XXX inefficiency here, normalization is not necessary
49 if ($this->empty) {
50 return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null);
51 } else {
52 $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor);
53 $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor);
54 //$end->start = $start;
55 return array($start, $end);
56 }
57 }
58}
59