Heredoc indentation detector ignores blank lines without trailing whitespace.

This commit is contained in:
Sam Stephenson
2010-09-22 08:47:43 -05:00
parent c435647589
commit 01c14bc640
3 changed files with 11 additions and 2 deletions

View File

@@ -395,7 +395,7 @@
if (!(options.herecomment)) {
while ((match = HEREDOC_INDENT.exec(doc)) !== null) {
attempt = (typeof (_ref2 = match[2]) !== "undefined" && _ref2 !== null) ? match[2] : match[3];
if (!(typeof indent !== "undefined" && indent !== null) || attempt.length < indent.length) {
if (!(typeof indent !== "undefined" && indent !== null) || (0 < attempt.length) && (attempt.length < indent.length)) {
indent = attempt;
}
}