aboutsummaryrefslogtreecommitdiff
path: root/tools/extract-changes.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/extract-changes.hs')
-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