Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mvila/react-escape-html
ES6 tagged template string escaping HTML and producing a 'tainted string object' directly usable with React 'dangerouslySetInnerHTML' property
https://github.com/mvila/react-escape-html
Last synced: about 1 month ago
JSON representation
ES6 tagged template string escaping HTML and producing a 'tainted string object' directly usable with React 'dangerouslySetInnerHTML' property
- Host: GitHub
- URL: https://github.com/mvila/react-escape-html
- Owner: mvila
- Created: 2016-03-01T02:00:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-12T09:59:53.000Z (about 8 years ago)
- Last Synced: 2024-04-29T13:21:10.497Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-escape-html [![npm version](https://img.shields.io/npm/v/react-escape-html.svg)](https://www.npmjs.com/package/react-escape-html)
ES6 tagged template string escaping HTML and producing a 'tainted string object' directly usable with React 'dangerouslySetInnerHTML' property.
Use [wbinnssmith/eskape](https://github.com/wbinnssmith/eskape).
## Installation
```
npm install --save react-escape-html
```## Example
```javascript
var html = require('react-escape-html');var tag = '';
var safeHTMLString = html`This is a <b>dangerous</b> HTML tag: ${tag}!`;
var safeReactElement = <div dangerouslySetInnerHTML={safeHTMLString} />;
```## License
MIT