html-arborist
v3.0.2
Published
Clean and sanitise html snippets
Downloads
5
Maintainers
Readme
HTML Arborist
Parse HTML into a object model, and perform tree surgery.
A library that parses HTML into an object model. Allowing you to perform complex transforms on the tree of nodes, and stitch it back together producing modified HTML.
It's a little rough around the edges, not optimised, and not flexible. These things will change over time. This is the start.
Table of Contents
Usage
const htmlArborist = require('html-arborist');
htmlArborist('<html><body><h1 onclick="alert(\'hello\')">Hello</h1></body></html>'); // <h2>Hello</h2>
API
A much more refined API allowing you to specify what transforms, and options for those transforms is coming.
Contribute
See the contribute file!
PRs accepted.