Fix extract-changes.hs to use new changelog.md format.
commit415ddbe228fe3da1a8472e589f1ebd26a66332a2
authorJohn MacFarlane <jgm@berkeley.edu>
dateFri 22 Nov 2019, 09:42 (7 years ago)
parent36f02e1
tools/extract-changes.hs+6−3
@@ -7,6 +7,9 @@ import Text.Pandoc.JSON
77main = toJSONFilter extractFirst
88
99extractFirst :: Pandoc -> Pandoc
10−extractFirst (Pandoc meta (Para{} : BulletList bs : _)) =
11− Pandoc meta [BulletList bs]
12−extractFirst x = x
10+extractFirst (Pandoc meta bs) =
11+ let bs' = dropWhile (not . isSubhead) bs
12+ in Pandoc meta (takeWhile (not . isSubhead) (drop 1 bs'))
13+
14+isSubhead (Header 2 _ _) = True
15+isSubhead _ = False