diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-11-22 09:42:04 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-11-22 09:42:04 -0800 |
commit | 415ddbe228fe3da1a8472e589f1ebd26a66332a2 (patch) | |
tree | a6bf19621c0d03a2554db1d4ec12b1844e0d0657 /tools | |
parent | 36f02e1673651fd1b1e310c44ecf285a7cca80a0 (diff) | |
download | pandoc-415ddbe228fe3da1a8472e589f1ebd26a66332a2.tar.gz |
Fix extract-changes.hs to use new changelog.md format.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/extract-changes.hs | 9 |
1 files changed, 6 insertions, 3 deletions
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 |