From 415ddbe228fe3da1a8472e589f1ebd26a66332a2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Nov 2019 09:42:04 -0800 Subject: Fix extract-changes.hs to use new changelog.md format. --- tools/extract-changes.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/extract-changes.hs b/tools/extract-changes.hs index 0a7f2a8cf..d0ef35888 100755 --- a/tools/extract-changes.hs +++ b/tools/extract-changes.hs @@ -7,6 +7,9 @@ import Text.Pandoc.JSON main = toJSONFilter extractFirst extractFirst :: Pandoc -> Pandoc -extractFirst (Pandoc meta (Para{} : BulletList bs : _)) = - Pandoc meta [BulletList bs] -extractFirst x = x +extractFirst (Pandoc meta bs) = + let bs' = dropWhile (not . isSubhead) bs + in Pandoc meta (takeWhile (not . isSubhead) (drop 1 bs')) + +isSubhead (Header 2 _ _) = True +isSubhead _ = False -- cgit v1.2.3