-
-
Save coen-hyde/4167690 to your computer and use it in GitHub Desktop.
Pretty print HTML but not JS test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var html = require('html'), | |
fs = require('fs'), | |
content = fs.readFileSync('minified.html', 'utf8'), | |
skipTags = ['script'], | |
prettyOptions = {'unformatted': ['script']}, | |
beautifulContent = html.prettyPrint(content, prettyOptions), | |
beautifulContentDefault = html.prettyPrint(content); | |
// console.log(beautifulContent); | |
console.log(beautifulContentDefault); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div><div><div><script>console.log('hey');console.log('what\'s up doc?');console.log('nada mucho senor');</script></div></div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "gist-4167514", | |
"version": "0.0.0", | |
"description": "Pretty print HTML but not JS test", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "git://gist.github.com/4167514.git gist-4167514" | |
}, | |
"author": "Todd Wolfson", | |
"license": "MIT", | |
"dependencies": { | |
"html": "0.0.6" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment