Skip to content

Instantly share code, notes, and snippets.

@stoyan
Created February 21, 2013 17:04
Show Gist options
  • Save stoyan/5006263 to your computer and use it in GitHub Desktop.
Save stoyan/5006263 to your computer and use it in GitHub Desktop.
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