This action recieves HTML input and repairs broken HTML tag syntax, removes specifed HTML tags and attributes, sets the "rel" attribute to "nofollow" on anchor tags and removes scripts, based on the settings that are selected and set by the user.
Typical Use Cases
- Apply to the input of a field in a form before the data is saved to your database.
- Apply to HTML recieved via an API before it is saved to your database.
- Apply to the content of an incoming email before the content is saved to your database.
Don't use it to
- Sanitize multiple inputs at once. Use a separate action for each input.
- To prevent SQL injection. Use Bind Tokens in your Run SQL Query action instead.
|Generate PDF||Uses wkhtmltopdf open source to generate PDF from HTML template. Use Sanitize HTML to remove specific tags or just make sure the HTML is complete before sending it to the pdf.|
|Send Email||Sends an email to one or multiple recipients. Use Sanitize HTML to remove scripts and make sure the HTML is cleaned up before sending it the the email action.|
|Run SQL Query||Executes an SQL statement and captures the output. Use Sanitize HTML to remove scripts and make sure the HTML is cleaned up before saving it to your database.|
|Server Request||A low-level action that allows for any kind of HTTP request to be performed. If this action is returning HTML, use Sanitize HTML to remove scripts and make sure the HTML is cleaned up before passing it to subsequent actions.|
Input Parameter Reference
|Html Content||The HTML content to be sanitized. Most often this will be a token from the input source.||Yes||No|
|Convert links to nofollow||Ensures all anchor tags in the provided HTML content have the "rel" attribute value set to "nofollow".||No||false||No|
|Removable attributes||The attributes specified here will be stripped off the HTML tags that were allowed in the provided HTML. Enter one at a time and press enter.||No||No|
|Disable scripts||Removes all script tags and their content from the provided HTML.||No||false||No|
|Toggle between Exclude/Allow HTML tag lists||Applies to the Excluded Tags option below. When this option is checked Allow Mode is in effect.||No||Exclude||No|
|Excluded Tags||HTML tags specified here will be removed from the provided content. All other tags will remain in place. Content between the removed tags will also remain||No||No|
|Allowed Tags||Only HTML tags specified here will be preserved. All other tags will be deleted and their content processed recursively.||No||No|
|Removable Tags||Removes specified tags and the content within the tags.||No||No|
Output Parameters Reference
|Output Token Name||The token name in which the response is to be stored for further use.|
1. Remove Scripts and Common Mouse Event Attributes
2. Restrict users ability to submit complex HTML
This example also disables scripts. In addition it adds the "rel=nofollow" attribute to all links, restricts the user to a limited list of very basic HTML tags, and prevents them from using inline styles.