From 04d4dd50ab8b1d24720948a87e6c9052fcc9a663 Mon Sep 17 00:00:00 2001 From: roife Date: Fri, 29 Sep 2023 02:41:10 +0800 Subject: [PATCH] Fix #418 --- extension/_test/tasklist.txt | 21 +++++++++++++++++++++ extension/tasklist.go | 3 +++ 2 files changed, 24 insertions(+) diff --git a/extension/_test/tasklist.txt b/extension/_test/tasklist.txt index dad65c6..256eca4 100644 --- a/extension/_test/tasklist.txt +++ b/extension/_test/tasklist.txt @@ -28,3 +28,24 @@
  • bim
  • //= = = = = = = = = = = = = = = = = = = = = = = =// + + + +3 +//- - - - - - - - -// +- test[x]=[x] +//- - - - - - - - -// + +//= = = = = = = = = = = = = = = = = = = = = = = =// + + +4 +//- - - - - - - - -// ++ [x] [x] +//- - - - - - - - -// + +//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/extension/tasklist.go b/extension/tasklist.go index dc86c37..4467ebf 100644 --- a/extension/tasklist.go +++ b/extension/tasklist.go @@ -41,6 +41,9 @@ func (s *taskCheckBoxParser) Parse(parent gast.Node, block text.Reader, pc parse return nil } + if parent.HasChildren() { + return nil + } if _, ok := parent.Parent().(*gast.ListItem); !ok { return nil }