aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2020-06-28 19:35:50 +0200
committerGitHub <noreply@github.com>2020-06-28 10:35:50 -0700
commit19175af811b7a95c4e732466cddac04947c01917 (patch)
tree57b2502a1d710484ffd9936eae450875d57033d2 /test
parentd2d5eb8a993553eb5d1b9b9ca7863638864dde7e (diff)
downloadpandoc-19175af811b7a95c4e732466cddac04947c01917.tar.gz
JATS reader: parse abstract element into metadata field of same name (#6482)
Closes: #6480
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/JATS.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Tests/Readers/JATS.hs b/test/Tests/Readers/JATS.hs
index 2ac0f6d8f..3c61f602f 100644
--- a/test/Tests/Readers/JATS.hs
+++ b/test/Tests/Readers/JATS.hs
@@ -21,6 +21,8 @@ import Text.Pandoc
import Text.Pandoc.Arbitrary ()
import Text.Pandoc.Builder
+import qualified Data.Text as T
+
jats :: Text -> Pandoc
jats = purely $ readJATS def
@@ -126,4 +128,19 @@ tests = [ testGroup "inline code"
\</sec>"
=?> header 1 (image "imgs/foo.jpg" "" mempty)
]
+
+ , testGroup "metadata"
+ [ test jats "abstract" $
+ T.unlines [ "<front>"
+ , "<article-meta>"
+ , "<abstract>"
+ , "<p>Paragraph 1</p>"
+ , "<p>Paragraph 2</p>"
+ , "</abstract>"
+ , "</article-meta>"
+ , "</front>"
+ ] =?>
+ let abstract = para "Paragraph 1" <> para "Paragraph 2"
+ in setMeta "abstract" abstract $ doc mempty
+ ]
]