diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-04-28 12:46:52 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-04-28 22:21:34 +0200 |
commit | 85f379e474be72ae0f7a53ebc5efe2ad4f8165b4 (patch) | |
tree | 7c95ec5002ad57dd7206c7b9f376809fcf653872 /test | |
parent | 0921b82d98b6ec7fa80ffd522c129b3828b9c00b (diff) | |
download | pandoc-85f379e474be72ae0f7a53ebc5efe2ad4f8165b4.tar.gz |
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
`<named-content>` element. Otherwise a `<styled-content>` element is
used instead.
Closes: #7211
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Writers/JATS.hs | 14 |
1 files changed, 9 insertions, 5 deletions
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" =?> "<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>" + , "converted to named-content element if class given" =: + spanWith ("a", ["genus-species"], [("alt", "aa")]) "C. elegans" =?> + ("<p><named-content id=\"a\" alt=\"aa\" content-type=\"genus-species\">" + <> "C. elegans</named-content></p>") - , "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" =?> "<p>text in span</p>" + , "use content-type attribute if present" =: + spanWith ("", [], [("content-type", "species")]) "E. coli" =?> + "<p><named-content content-type=\"species\">E. coli</named-content></p>" ] ] |