sanitize html

This block is part of the value group and was last modified in core v10.4.28.

sanitize html v10.4.28

Sanitizes the given html

In pins 3
  • html required
    value

    The html to sanitize

  • allowed tags
    array

    Given tags will be allowed in the user input (example: div, p)

  • allowed attributes
    array

    Given attributes will be allowed in the user input (example: style, id)

Out pins 1
  • value
    value

With allowed_tags empty, strips ALL HTML tags; script and style elements lose their CONTENT too, not just the tags. With allowed_tags set, disallowed tags are removed (their inner text kept) and allowed tags keep only attributes listed in allowed_attr -- an empty allowed_attr strips every attribute. Regex-based tag filtering, not a full HTML parser.

A typical wiring for sanitize html: value feeds the html pin; the value out pin feeds convert to uppercase.

Studio canvas example for the sanitize html block: typical wiring for sanitize html.

Version history

Introduced in v10.4.28.


Back to value Return to the main group to view all sub-groups Back to value Return to the group to view all blocks within this group