From 85f379e474be72ae0f7a53ebc5efe2ad4f8165b4 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 28 Apr 2021 12:46:52 +0200 Subject: JATS writer: use either styled-content or named-content for spans. If the element has a content-type attribute, or at least one class, then that value is used as `content-type` and the span is put inside a `` element. Otherwise a `` element is used instead. Closes: #7211 --- test/Tests/Writers/JATS.hs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/Tests/Writers/JATS.hs b/test/Tests/Writers/JATS.hs index e90438176..5b96ed2ed 100644 --- a/test/Tests/Writers/JATS.hs +++ b/test/Tests/Writers/JATS.hs @@ -148,13 +148,17 @@ tests = spanWith nullAttr "text in span" =?> "

text in span

" - , "converted to named-content element" =: - spanWith ("a", ["ignored"], [("alt", "aa")]) "text" =?> - "

text

" + , "converted to named-content element if class given" =: + spanWith ("a", ["genus-species"], [("alt", "aa")]) "C. elegans" =?> + ("

" + <> "C. elegans

") - , "unwrapped if named-content element would have no attributes" =: - spanWith ("", ["ignored"], [("hidden", "true")]) "text in span" =?> + , "unwrapped if styled-content element would have no attributes" =: + spanWith ("", [], [("hidden", "true")]) "text in span" =?> "

text in span

" + , "use content-type attribute if present" =: + spanWith ("", [], [("content-type", "species")]) "E. coli" =?> + "

E. coli

" ] ] -- cgit v1.2.3