1.0.12 • Published 1 month ago

amuchina v1.0.12

Weekly downloads
-
License
-
Repository
github
Last release
1 month ago

Amuchina

A work-in-progress HTML sanitizer that strives for: performance like window.Sanitizer, readiness like DOMPurify, and ability to run in a WebWorker like neither of those.

This is basically an implementation of a subset of the upcoming Sanitizer API, but it also supports SVG and MathML out of the box.

Install

npm install --save amuchina

Usage

import Amuchina from 'amuchina';

const amuchina = new Amuchina ();
const parser = new DOMParser ();

const parse = ( html: string ) => parser.parseFromString ( html, 'text/html' );

amuchina.sanitize ( parse ( `<img src="/err" onerror="javascript:alert('naughty!')" />` ) );

License

MIT © Fabio Spampinato

1.0.12

1 month ago

1.0.11

1 year ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago