Skip to content

Commit 167043d

Browse files
author
Airan Shao
committed
Fix issue #60
Parser.getNextEmbedBlock() should not return if current line is comment or blank.
1 parent 97d39b6 commit 167043d

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
@@ -333,17 +333,16 @@ class Parser
333333
if indent is newIndent
334334
removeComments = not removeCommentsPattern.test @currentLine
335335

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

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

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

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

0 commit comments

Comments
 (0)