You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running into a case where I would like to enforce having two specific attributes on a tag, else the tag is illegal.
As an example, <bar> should only be allowed if both attributes argh and blubb are present:
This leads to both attributes being allowed solo, which I don't want. Is there a way to write this constraint in the builder syntax or would I have to use the allowElements with lambda function interface and implement this full manual?
The one thing that is very weird is, if I sanitize <bar argh="test"></bar> with this policy, the attributes list contains two elements, argh and test (which is a value and not an attribute). Is this by design? Is there any reason why this is a string list with key/value after each other instead of a key-value Map?
The text was updated successfully, but these errors were encountered:
Hi,
I am running into a case where I would like to enforce having two specific attributes on a tag, else the tag is illegal.
As an example,
<bar>
should only be allowed if both attributesargh
andblubb
are present:I tried something like:
This leads to both attributes being allowed solo, which I don't want. Is there a way to write this constraint in the builder syntax or would I have to use the
allowElements
with lambda function interface and implement this full manual?I tried implementing the rule like this:
The one thing that is very weird is, if I sanitize
<bar argh="test"></bar>
with this policy, theattributes
list contains two elements,argh
andtest
(which is a value and not an attribute). Is this by design? Is there any reason why this is a string list with key/value after each other instead of a key-valueMap
?The text was updated successfully, but these errors were encountered: