aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-11-22 09:42:04 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-22 09:42:04 -0800
commit415ddbe228fe3da1a8472e589f1ebd26a66332a2 (patch)
treea6bf19621c0d03a2554db1d4ec12b1844e0d0657 /tools
parent36f02e1673651fd1b1e310c44ecf285a7cca80a0 (diff)
downloadpandoc-415ddbe228fe3da1a8472e589f1ebd26a66332a2.tar.gz
Fix extract-changes.hs to use new changelog.md format.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/extract-changes.hs9
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