for doc and text now leading indent is not ignored...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-09-12 02:18:17 +03:00
parent 35eea57ab9
commit a729bf85d6
2 changed files with 5 additions and 2 deletions

View File

@ -86,7 +86,10 @@ function(text, tab_size, leading_tabs){
text = tab != '' ?
text.replace(/\t/g, tab)
: text
var lines = text.trim().split(/\n/)
var lines = text.trimEnd().split(/\n/)
// remove leading blank lines...
while(lines[0].trim() == ''){
lines.shift() }
// count common indent...
var l = lines
.reduce(function(l, e, i){

View File

@ -28,6 +28,6 @@
"devDependencies": {
"c8": "^7.3.0",
"colors": "^1.4.0",
"ig-test": "^1.3.8"
"ig-test": "^1.4.4"
}
}