From b3b00da43d5727b050b8647dff3b9600c275a1a0 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 7 Jan 2016 19:56:44 +0100 Subject: Fix function dropping subtrees tagged :noexport: Continue scanning for comment subtrees beyond only the first block. Note to self: when writing an recursive function, don't forget to, you know, actually recurse. Shout to @mrvdb for noticing this. This fixes #2628. --- src/Text/Pandoc/Readers/Org.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index 99a6927e2..c7906618c 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -87,8 +87,10 @@ parseOrg = do -- | Drop COMMENT headers and the document tree below those headers. dropCommentTrees :: [Block] -> [Block] dropCommentTrees [] = [] -dropCommentTrees blks@(b:bs) = - maybe blks (flip dropUntilHeaderAboveLevel bs) $ commentHeaderLevel b +dropCommentTrees (b:bs) = + maybe (b:dropCommentTrees bs) + (dropCommentTrees . flip dropUntilHeaderAboveLevel bs) + (commentHeaderLevel b) -- | Return the level of a header starting a comment or :noexport: tree and -- Nothing otherwise. -- cgit v1.2.3