dangerous-html

0.1.13 • Public • Published

A simple custom-element to render html using lit-html.

Browsers by default won't render any html that is injected using innerHtml. In extreme cases where we want this to happen. And when the user is in control of scripts they are trying to add. You can use this simple custom-element.

⚠️ ⚠️ ⚠️

Install

yarn add danngerous-html

Usage

If you are using it in any build system based projects. You can just import the module and leave it.

import './dangerous-html'

If you are using with traditional scripts.

<script type="text/javascript" src="https://unpkg.com/dangerous-html/dist/lib.umd.js" ></script>

Example

<dangerous-html html='...html...'></dangerous-html>

Readme

Keywords

none

Package Sidebar

Install

npm i dangerous-html

Weekly Downloads

945

Version

0.1.13

License

MIT

Unpacked Size

71.9 kB

Total Files

18

Last publish

Collaborators

  • jkrishna