diff --git a/_test/extra.txt b/_test/extra.txt
index 7c95ca4..7b3ec0c 100644
--- a/_test/extra.txt
+++ b/_test/extra.txt
@@ -235,3 +235,91 @@ bbb
//= = = = = = = = = = = = = = = = = = = = = = = =//
+
+17: fenced code block in list, empty line, spaces on start
+//- - - - - - - - -//
+* foo
+ ```Makefile
+ foo
+
+ foo
+ ```
+//- - - - - - - - -//
+
+//= = = = = = = = = = = = = = = = = = = = = = = =//
+
+18: fenced code block in list, empty line, no spaces on start
+//- - - - - - - - -//
+* foo
+ ```Makefile
+ foo
+
+ foo
+ ```
+//- - - - - - - - -//
+
+//= = = = = = = = = = = = = = = = = = = = = = = =//
+
+
+19: fenced code block inside nested list, empty line, spaces on start
+//- - - - - - - - -//
+* foo
+ - bar
+ ```Makefile
+ foo
+
+ foo
+ ```
+//- - - - - - - - -//
+
+//= = = = = = = = = = = = = = = = = = = = = = = =//
+
+
+20: fenced code block inside nested list, empty line, no space on start
+//- - - - - - - - -//
+* foo
+ - bar
+ ```Makefile
+ foo
+
+ foo
+ ```
+//- - - - - - - - -//
+
+//= = = = = = = = = = = = = = = = = = = = = = = =//
diff --git a/parser/list.go b/parser/list.go
index 9183a6d..4460282 100644
--- a/parser/list.go
+++ b/parser/list.go
@@ -164,6 +164,8 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta
if node.ChildCount() == 1 && node.LastChild().ChildCount() == 0 {
return Close
}
+
+ reader.Advance(len(line)-1)
return Continue | HasChildren
}
diff --git a/parser/list_item.go b/parser/list_item.go
index 4a698d8..6c8db95 100644
--- a/parser/list_item.go
+++ b/parser/list_item.go
@@ -53,6 +53,8 @@ func (b *listItemParser) Open(parent ast.Node, reader text.Reader, pc Context) (
func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context) State {
line, _ := reader.PeekLine()
if util.IsBlank(line) {
+ reader.Advance(len(line)-1)
+
return Continue | HasChildren
}