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

1.0.1 • Public • Published

Render Wysiwyg 🚀

It allows you to render any Wysiwyg text in React

Installation

npm install render-wysiwyg

or

yarn add render-wysiwyg

Example

import React from "react";
import RenderWysiwyg from "render-wysiwyg";

const MyComponent: React.FC = () => {
  const content = "<p>This is some <b>HTML</b> content.</p>";
  
  return (
    <div>
      <h1>RenderWysiwyg Example</h1>
      <RenderWysiwyg content={content} />
    </div>
  );
}

export default MyComponent;

Security Note 🔒

The RenderWysiwyg component uses DOMPurify to sanitize the HTML content before rendering it. This helps prevent XSS (Cross-Site Scripting) attacks by removing potentially harmful elements and attributes from the content.

However, it's important to note that no sanitization method is foolproof, and it's always a good practice to validate and sanitize user-generated content on the server-side as well.

Authors

Bakeli School Of Technology (RED Team)

Readme

Keywords

Package Sidebar

Install

npm i render-wysiwyg

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

4.62 kB

Total Files

11

Last publish

Collaborators

  • red-team