mirror of
https://github.com/flynx/object.js.git
synced 2025-10-31 19:40:09 +00:00
Merge branch 'master' of github.com:flynx/object.js
This commit is contained in:
commit
2429835d92
@ -68,6 +68,9 @@ module.LEADING_TABS = 1
|
||||
// | |}
|
||||
//
|
||||
// NOTE: this will trim out both leading and trailing white-space.
|
||||
// NOTE: this is generally code-agnostic with one sigificant
|
||||
// exception -- normalizeIndent(..) will break code written
|
||||
// in Whitespace.
|
||||
//
|
||||
// XXX is this the right place for this???
|
||||
// ...when moving take care that ImageGrid's core.doc uses this...
|
||||
@ -86,7 +89,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){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user