Minor changes

This commit is contained in:
J. King 2023-04-22 19:18:15 -04:00
parent eee4d65faf
commit a8482fa8c3
3 changed files with 14 additions and 4 deletions

View file

@ -159,10 +159,11 @@ class RoboFile extends \Robo\Tasks {
public function constants(): Result {
$c = $this->collectionBuilder()->addCode(function() {
$out = ['elem' => [], 'attr' => []];
$elems = [];
$atrs = [];
// retrieve the single-page HTML specification (this is around 15MB in size)
$spec = file_get_contents("https://html.spec.whatwg.org/");
$attrs = [];
// retrieve the single-page HTML specification (this is around 12MB in size)
$spec = file_get_contents("html.html"); //$spec = file_get_contents("https://html.spec.whatwg.org/");
// parse it (this may take several seconds
if ($spec) {
$p = new DOMParser;
@ -186,7 +187,11 @@ class RoboFile extends \Robo\Tasks {
}
}
}
// do a second pass over what's been collected to find global attributes and normalize them to a single "*" entry
}
//$spec = file_get_contents("aria.html"); //$spec = file_get_contents("https://www.w3.org/TR/wai-aria/");
//$spec = file_get_contents("svg-elem.html"); //$spec = file_get_contents("https://www.w3.org/TR/SVG2/eltindex.html");
//$spec = file_get_contents("svg-attr.html"); //$spec = file_get_contents("https://www.w3.org/TR/SVG2/attindex.html");
// sort and filter the results for unqiueness
sort($elems);
ksort($attrs);

View file

@ -1,5 +1,5 @@
{
"name": "mensbeam/html-sanitizr",
"name": "mensbeam/html-sanitizer",
"description": "An implementation of the HTML Sanitizer API",
"keywords": ["whatwg", "html", "html5", "sanitizer", "dom"],
"type": "library",

View file

@ -777,6 +777,11 @@ abstract class AbstractSanitizer {
# To determine the sanitize action for an attribute given a Sanitizer
# configuration dictionary config, run these steps:
# Let kind be attributes attribute kind.
# The attribute kind of an attribute is one of regular
# or unknown. Let attribute kind be:
# - unknown, if the [HTML] specification does not assign any
# meaning to attributes name.
# - regular, otherwise.
# If kind is unknown and if config["allowUnknownMarkup"] does not exist or it config["allowUnknownMarkup"] is false: Return drop.
# If kind is regular and attributes local name does not match any name in the baseline attribute allow list: Return drop.
# If attribute matches any attribute match list in configs attribute drop list: Return drop.