Skip to content

Instantly share code, notes, and snippets.

@stoyan stoyan/clean.js
Created Feb 21, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.