Fix extract-changes.hs to use new changelog.md format.

This commit is contained in:
John MacFarlane 2019-11-22 09:42:04 -08:00
parent 36f02e1673
commit 415ddbe228

View file

@ -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