This component is used to manipulate HTML. It can be used to make HTML a user enters safe to display, avoiding various potential security issues. Another use is to easily show raw HTML code on a page to allow a user to copy and paste the code into other sites.
Copy and paste this code into your own site to support us:
<fm:HTMLSanitizer mode="escape">
<a href="http://www.example.org">Visit our sponsor</a>
</fm:HTMLSanitizer>
<a href="http://www.example.org">Visit our sponsor</a>
<fm:HTMLSanitizer>
<script type="text/javascript">This is evil code and will be removed</script>
<p><b><i>The tag order here is messed up and will be fixed</p></b>
<br>
<br>
The previous breaks didn't contain the /, which is required in XHTML. This will also be fixed.
</fm:HTMLSanitizer>
<p><b><i>The tag order here is messed up and will be fixed</i></b></p> <br /><br /> The previous breaks didn't contain the /, which is required in XHTML. This will also be fixed.
Name | Required | Default | Description |
---|---|---|---|
mode | Optional | sanitize | Whether to sanitize or escape the content. Valid values are "sanitize" and "escape". |
trim | Optional | When set to anything but empty this will remove all whitespace. This defaults to being off. |