summaryrefslogtreecommitdiff
path: root/plugins/af_readability/vendor/masterminds/html5/bin/entities.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-07-24 14:03:04 +0300
committerAndrew Dolgov <[email protected]>2022-07-24 14:03:04 +0300
commit5006c754c42a09f5b88b258c2da4b9eff7508357 (patch)
tree841425d4e163d746642d70b8ac0df381343bbf2b /plugins/af_readability/vendor/masterminds/html5/bin/entities.php
parentf7b3c50828d4604ac5999daf3c3405e65c877e2f (diff)
readability: add missing dependencies
Diffstat (limited to 'plugins/af_readability/vendor/masterminds/html5/bin/entities.php')
-rw-r--r--plugins/af_readability/vendor/masterminds/html5/bin/entities.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/af_readability/vendor/masterminds/html5/bin/entities.php b/plugins/af_readability/vendor/masterminds/html5/bin/entities.php
new file mode 100644
index 000000000..56323a341
--- /dev/null
+++ b/plugins/af_readability/vendor/masterminds/html5/bin/entities.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Fetch the entities.json file and convert to PHP datastructure.
+ */
+
+// The URL to the official entities JSON file.
+$ENTITIES_URL = 'http://www.w3.org/TR/2012/CR-html5-20121217/entities.json';
+
+$payload = file_get_contents($ENTITIES_URL);
+$json = json_decode($payload);
+
+$table = array();
+foreach ($json as $name => $obj) {
+ $sname = substr($name, 1, -1);
+ $table[$sname] = $obj->characters;
+}
+
+echo '<?php
+namespace Masterminds\\HTML5;
+/** Entity lookup tables. This class is automatically generated. */
+class Entities {
+ public static $byName = ';
+var_export($table);
+echo ';
+}' . PHP_EOL;
+//print serialize($table);