diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-07-31 19:09:06 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-07-31 19:09:06 +0200 |
commit | 3db95a85de1297908e780742cd0b7d779c5f522e (patch) | |
tree | 49feb12066a53d2fbbb4c7ed342f6d9b23e516ae /inc/JSLikeHTMLElement.php | |
parent | 95a7596cb4757e33d31bde1daac9f10c17bec1d4 (diff) | |
download | wallabag-3db95a85de1297908e780742cd0b7d779c5f522e.tar.gz wallabag-3db95a85de1297908e780742cd0b7d779c5f522e.tar.zst wallabag-3db95a85de1297908e780742cd0b7d779c5f522e.zip |
update external libs
Diffstat (limited to 'inc/JSLikeHTMLElement.php')
-rw-r--r-- | inc/JSLikeHTMLElement.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/JSLikeHTMLElement.php b/inc/JSLikeHTMLElement.php index dfcc1be5..238ba8a8 100644 --- a/inc/JSLikeHTMLElement.php +++ b/inc/JSLikeHTMLElement.php | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * This class extends PHP's DOMElement to allow | 5 | * This class extends PHP's DOMElement to allow |
6 | * users to get and set the innerHTML property of | 6 | * users to get and set the innerHTML property of |
7 | * HTML elements in the same way it's done in | 7 | * HTML elements in the same way it's done in |
8 | * JavaScript. | 8 | * JavaScript. |
9 | * | 9 | * |
10 | * Example usage: | 10 | * Example usage: |
@@ -15,16 +15,16 @@ | |||
15 | * $doc->registerNodeClass('DOMElement', 'JSLikeHTMLElement'); | 15 | * $doc->registerNodeClass('DOMElement', 'JSLikeHTMLElement'); |
16 | * $doc->loadHTML('<div><p>Para 1</p><p>Para 2</p></div>'); | 16 | * $doc->loadHTML('<div><p>Para 1</p><p>Para 2</p></div>'); |
17 | * $elem = $doc->getElementsByTagName('div')->item(0); | 17 | * $elem = $doc->getElementsByTagName('div')->item(0); |
18 | * | 18 | * |
19 | * // print innerHTML | 19 | * // print innerHTML |
20 | * echo $elem->innerHTML; // prints '<p>Para 1</p><p>Para 2</p>' | 20 | * echo $elem->innerHTML; // prints '<p>Para 1</p><p>Para 2</p>' |
21 | * echo "\n\n"; | 21 | * echo "\n\n"; |
22 | * | 22 | * |
23 | * // set innerHTML | 23 | * // set innerHTML |
24 | * $elem->innerHTML = '<a href="http://fivefilters.org">FiveFilters.org</a>'; | 24 | * $elem->innerHTML = '<a href="http://fivefilters.org">FiveFilters.org</a>'; |
25 | * echo $elem->innerHTML; // prints '<a href="http://fivefilters.org">FiveFilters.org</a>' | 25 | * echo $elem->innerHTML; // prints '<a href="http://fivefilters.org">FiveFilters.org</a>' |
26 | * echo "\n\n"; | 26 | * echo "\n\n"; |
27 | * | 27 | * |
28 | * // print document (with our changes) | 28 | * // print document (with our changes) |
29 | * echo $doc->saveXML(); | 29 | * echo $doc->saveXML(); |
30 | * @endcode | 30 | * @endcode |
@@ -59,7 +59,7 @@ class JSLikeHTMLElement extends DOMElement | |||
59 | $value = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8'); | 59 | $value = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8'); |
60 | // Using <htmlfragment> will generate a warning, but so will bad HTML | 60 | // Using <htmlfragment> will generate a warning, but so will bad HTML |
61 | // (and by this point, bad HTML is what we've got). | 61 | // (and by this point, bad HTML is what we've got). |
62 | // We use it (and suppress the warning) because an HTML fragment will | 62 | // We use it (and suppress the warning) because an HTML fragment will |
63 | // be wrapped around <html><body> tags which we don't really want to keep. | 63 | // be wrapped around <html><body> tags which we don't really want to keep. |
64 | // Note: despite the warning, if loadHTML succeeds it will return true. | 64 | // Note: despite the warning, if loadHTML succeeds it will return true. |
65 | $result = @$f->loadHTML('<htmlfragment>'.$value.'</htmlfragment>'); | 65 | $result = @$f->loadHTML('<htmlfragment>'.$value.'</htmlfragment>'); |
@@ -86,7 +86,7 @@ class JSLikeHTMLElement extends DOMElement | |||
86 | * @code | 86 | * @code |
87 | * $string = $div->innerHTML; | 87 | * $string = $div->innerHTML; |
88 | * @endcode | 88 | * @endcode |
89 | */ | 89 | */ |
90 | public function __get($name) | 90 | public function __get($name) |
91 | { | 91 | { |
92 | if ($name == 'innerHTML') { | 92 | if ($name == 'innerHTML') { |