Skip to content

Commit 4ea1e60

Browse files
authored
Merge pull request #79 from ar-shao/issue#60
Fix issue #60
2 parents 5e74781 + 167043d commit 4ea1e60

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Parser.coffee

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,17 +334,16 @@ class Parser
334334
if indent is newIndent
335335
removeComments = not removeCommentsPattern.test @currentLine
336336

337-
if isItUnindentedCollection and not @isStringUnIndentedCollectionItem(@currentLine) and indent is newIndent
338-
@moveToPreviousLine()
339-
break
337+
if removeComments and @isCurrentLineComment()
338+
continue
340339

341340
if @isCurrentLineBlank()
342341
data.push @currentLine[newIndent..]
343342
continue
344343

345-
if removeComments and @isCurrentLineComment()
346-
if indent is newIndent
347-
continue
344+
if isItUnindentedCollection and not @isStringUnIndentedCollectionItem(@currentLine) and indent is newIndent
345+
@moveToPreviousLine()
346+
break
348347

349348
if indent >= newIndent
350349
data.push @currentLine[newIndent..]

0 commit comments

Comments
 (0)