A React component that will sanitize user-inputted HTML code, using the popular
npm install react-sanitized-html sanitize-html --save to install this package.
firstname.lastname@example.org, shorthands are not used. Thus, it is possible to build a workaround for IE8 by customizing both [
htmlparser2] and [
domhandler] without shorthands.
import SanitizedHTML from 'react-sanitized-html';const HTML_FROM_USER = '<a href="">Bing</a>';ReactDOM;
It will output as:
You can add
sanitize-html options as props. For example,
You can find more options here.
To setup your development environment, after cloning the repository, run the following steps.
npm install react sanitize-html npm install --only=development
npm test to run all tests.
Like us? Star us.
Found an issue? File us an issue.