Created
February 21, 2013 17:04
-
-
Save stoyan/5006263 to your computer and use it in GitHub Desktop.
AsciiDoc unit test cleanup
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 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