Create a gist now

Instantly share code, notes, and snippets.

AsciiDoc unit test cleanup
var clean = require('fs').readFileSync('book.asc').toString().split('\n').filter(function(line) {
if (line.indexOf('/*nolint*/') === 0 ||
line.indexOf('/*global') === 0 ||
line.indexOf('/*jshint') === 0) {
return false;
}
return true;
})
.join('\n')
.replace(/--\+\+--/g, '--')
.replace(/--\/\/--/g, '--')
.replace(/--\/\/\/\/--/g, '--')
.replace(/\/\/::/g, '//')
.replace(/::/g, ':')
.replace(/,,/g, ',')
;
console.log(clean);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment