Configuring HTML sanitizer
You must modify a script include to make configuration changes to the HTML sanitizer.
Avant de commencer
Procédure
Exemple
Consider the following example:
HTML_WHITELIST:{
globalAttributes:{
attribute:["id","name"],},
img:{
attribute:["style","align"],
attributeValuePattern:{src:".*jpeg"}},
iframe:{},}It adds the following items to the inclusion list:
- The global attributes id and name. This is a list of strings that can be applied globally to all the elements.
- The img element where the attributes are style and align.
- The img element where the source attribute of the image is a file with the .jpeg extension. This is an example of a regular expression pattern that matches an attribute value.
- The iframe element.