Fix extract-changes.hs to use new changelog.md format.
This commit is contained in:
parent
36f02e1673
commit
415ddbe228
1 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue