Wondering what’s next for npm?Check out our public roadmap! »

interweave
TypeScript icon, indicating that this package has built-in type declarations

12.7.0 • Public • Published

Interweave

Build Status npm version npm deps

Interweave is a robust React library that can...

  • Safely render HTML without using dangerouslySetInnerHTML.
  • Safely strip HTML tags.
  • Automatic XSS and injection protection.
  • Clean HTML attributes using filters.
  • Interpolate components using matchers.
  • Autolink URLs, IPs, emails, and hashtags.
  • Render Emoji and emoticon characters.
  • And much more!
<Interweave content="This string contains <b>HTML</b> and will safely be rendered!" />
<Interweave
  content="This contains a URL, https://github.com/milesj/interweave, and a hashtag, #interweave, that will be converted to an anchor link!"
  matchers={[new UrlMatcher('url'), new HashtagMatcher('hashtag')]}
/>

Requirements

  • React 16.8+ / 17+
  • IE 11+
  • Emoji support: fetch, sessionStorage

Installation

Interweave requires React as a peer dependency.

yarn add interweave react
// Or
npm install interweave react

Documentation

https://interweave.dev

Install

npm i interweave

DownloadsWeekly Downloads

31,326

Version

12.7.0

License

MIT

Unpacked Size

207 kB

Total Files

40

Last publish

Collaborators

  • avatar