Socket
Book a DemoInstallSign in
Socket

@squiz/xaccel-xss-safe-content

Package Overview
Dependencies
Maintainers
51
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@squiz/xaccel-xss-safe-content

React component that wraps dangerously set inner html to allow for displaying HTML content without xss issues being introduced

1.13.1
npmnpm
Version published
Weekly downloads
23
-65.67%
Maintainers
51
Weekly downloads
 
Created
Source

xss-safe-content

This package provides a React component that will escape dangerous HTML allowing WYSIWYG content to be safely used without possible XSS vulnerability injection vectors being added.

The component takes two defined props and spreads the others as HTML Attributes.

The two defined props are:

  • content - The html content as a string
  • elementType (optional) - as a string or a react functional component

The remaining props are expected to be HTML Elements properties or Class Attributes.

Usage:

import { XssSafeContent } from '@squiz/xaccel-xss-safe-content';

function SomeReactComponent({ content }) {
    return <XSSSafeContent content={content} elementType={'div'} />;
}

FAQs

Package last updated on 30 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.