aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-04-10 11:38:02 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2021-04-10 11:49:18 +0200
commit2d60524de43d59ffb1763a33a15cc2ecce613ecf (patch)
tree42ee81ec4cf5cf4b92f7901f39027de4a4922110 /test
parent051b7ffeaffdaf34ed1384a239cf0179aa59b932 (diff)
downloadpandoc-2d60524de43d59ffb1763a33a15cc2ecce613ecf.tar.gz
JATS writer: convert spans to <named-content> elements
Spans with attributes are converted to `<named-content>` elements instead of being wrapped with `<milestone-start/>` and `<milestone-end>` elements. Milestone elements are not allowed in documents using the articleauthoring tag set, so this change ensures the creation of valid documents. Closes: #7211
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Writers/JATS.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Tests/Writers/JATS.hs b/test/Tests/Writers/JATS.hs
index 23c1686dc..e90438176 100644
--- a/test/Tests/Writers/JATS.hs
+++ b/test/Tests/Writers/JATS.hs
@@ -142,4 +142,19 @@ tests =
codeWith ("7y",[],[]) "print 5" =?>
"<p><monospace id=\"U0037y\">print 5</monospace></p>"
]
+
+ , testGroup "spans"
+ [ "unwrapped if no attributes given" =:
+ spanWith nullAttr "text in span" =?>
+ "<p>text in span</p>"
+
+ , "converted to named-content element" =:
+ spanWith ("a", ["ignored"], [("alt", "aa")]) "text" =?>
+ "<p><named-content id=\"a\" alt=\"aa\">text</named-content></p>"
+
+ , "unwrapped if named-content element would have no attributes" =:
+ spanWith ("", ["ignored"], [("hidden", "true")]) "text in span" =?>
+ "<p>text in span</p>"
+
+ ]
]