Issue #3231334 by Wim Leers, bnjmnm: Global attributes (<* lang> and <*...
Issue #3231334 by Wim Leers, bnjmnm: Global attributes (<* lang> and <* dir="ltr rtl">): validation + support (fix data loss)
(cherry picked from commit 464291fb)
thrownew\InvalidArgumentException(sprintf('The "%s" HTML tag has an attribute restriction "%s" which is neither TRUE nor an array of attribute value restrictions.',$html_tag_name,$html_tag_attribute_name));
}
@@ -234,14 +263,17 @@ public function isUnrestricted(): bool {
}
/**
* Whether this is the empty set of HTML restrictions.
* Whether this set of HTML restrictions allows nothing.
*
* @return bool
*
* @see ::emptySet()
*/
publicfunctionisEmpty():bool{
returncount($this->elements)===0;
publicfunctionallowsNothing():bool{
returncount($this->elements)===0
// If there are only forbidden attributes on the global attribute `*` HTML
// tag, that is equivalent to the set of restrictions being empty.
thrownewInvalidPluginDefinitionException($id,sprintf('The "%s" CKEditor 5 plugin definition has a "drupal.elements" value that is neither a list of HTML tags/attributes nor false.',$id));
thrownewInvalidPluginDefinitionException($id,sprintf('The "%s" CKEditor 5 plugin definition has a value at "drupal.elements.%d" that is not an HTML tag with optional attributes: "%s". Expected structure: "<tag allowedAttribute="allowedValue1 allowedValue2">".',$id,$index,$element));