Skip to content

rhalff/dom-clean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dom Clean

Simple dom utility to strip comments from a dom tree and removes empty blank spaces.

To ensure traversing will only meet ELEMENT_NODEs or TEXT_NODEs.

Usage:

var DomClean = require('dom-clean').clean;
var el = document.body;
DomClean(el);

If you want to keep the comments use:

DomClean(el, true);

Test:

testem