Skip to content
This repository was archived by the owner on Jul 15, 2019. It is now read-only.

Commit 39e1b5b

Browse files
author
adon
committed
updated usage message and disabled line by line processing
1 parent 9b169d1 commit 39e1b5b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bin/html-purifier.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,26 @@ var Purifier = require('../src/html-purify'),
1414
(function() {
1515
var fs = require('fs'),
1616
file,
17-
lineByLine = false,
17+
// lineByLine = false,
1818
benchmark = false,
1919
noofargs = process.argv.length;
2020

2121
process.argv.forEach(function(val, index) {
2222
if (index === 2) {
2323
file = val;
2424
} else if (index === 3) {
25-
if (val === "-l") {
26-
lineByLine = true;
27-
} else if (val === "--benchmark") {
25+
if (val === "--benchmark") {
2826
benchmark = true;
2927
}
28+
// else if (val === "-l") {
29+
// lineByLine = true;
30+
// }
3031
}
3132
});
3233

3334

3435
if (noofargs < 3) {
35-
console.log("Usage: html-purifier <any html file>");
36+
console.log("Usage: html-purifier <html_filepath> [--benchmark]");
3637
process.exit(1);
3738
}
3839

@@ -43,7 +44,8 @@ var Purifier = require('../src/html-purify'),
4344

4445
var data = fs.readFileSync(file, 'utf-8'), i, output = '';
4546

46-
// The following is disabled as it might generate insecure html, since linebreak can exists within attr value state, while purify() assumes data state for each call
47+
// The following is disabled as it might generate insecure html,
48+
// as it could violate the assumption that purify() must start with the data state
4749
// if (lineByLine) {
4850
// // reading and processing line by line
4951
// var data2 = data.split(/\n/);

0 commit comments

Comments
 (0)