aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2023-02-17 23:03:32 +0100
committerAlbert Krewinkel <[email protected]>2023-02-18 00:09:21 +0100
commitd08d1c04c54a91eceff2ad3e8cc628b730a7cc9b (patch)
tree2ac1a95a72e96766b4f9ab407f9dad67651f3eed /test
parentda9c196e09ecd87b2d727294810357f485733be8 (diff)
JATS writer: include alt-text in `<graphic>`, `<inline-graphic>` elements
Closes: #8631
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Writers/JATS.hs4
-rw-r--r--test/command/figures-jats.md17
-rw-r--r--test/writer.jats_archiving5
-rw-r--r--test/writer.jats_articleauthoring5
-rw-r--r--test/writer.jats_publishing5
5 files changed, 29 insertions, 7 deletions
diff --git a/test/Tests/Writers/JATS.hs b/test/Tests/Writers/JATS.hs
index 8259c644e..8571ccd1d 100644
--- a/test/Tests/Writers/JATS.hs
+++ b/test/Tests/Writers/JATS.hs
@@ -134,7 +134,9 @@ tests =
, "containing image" =:
header 1 (image "imgs/foo.jpg" "" (text "Alt text")) =?>
"<sec>\n\
- \ <title><inline-graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"imgs/foo.jpg\" /></title>\n\
+ \ <title><inline-graphic mimetype=\"image\" mime-subtype=\"jpeg\" xlink:href=\"imgs/foo.jpg\">\n\
+ \ <alt-text>Alt text</alt-text>\n\
+ \ </inline-graphic></title>\n\
\</sec>"
]
diff --git a/test/command/figures-jats.md b/test/command/figures-jats.md
index a5089df2a..bc13bcb5b 100644
--- a/test/command/figures-jats.md
+++ b/test/command/figures-jats.md
@@ -12,3 +12,20 @@ Para [Image ("fig-id-2",[],[]) [] ("foo.png", "fig:")]]]
<graphic id="fig-id-2" mimetype="image" mime-subtype="png" xlink:href="foo.png" xlink:title="fig:" />
</fig>
```
+
+Figure float with caption and alt text.
+
+```
+% pandoc -f native -t jats
+[Figure ("fig-id",[],[]) (Caption Nothing [Para [Str "Caption"]]) [Para [Str "Text"],
+Para [Image ("fig-id-2",[],[]) [Str "alt"] ("foo.png", "fig:")]]]
+
+^D
+<fig id="fig-id">
+ <caption><p>Caption</p></caption>
+ <p>Text</p>
+ <graphic id="fig-id-2" mimetype="image" mime-subtype="png" xlink:href="foo.png" xlink:title="fig:">
+ <alt-text>alt</alt-text>
+ </graphic>
+</fig>
+```
diff --git a/test/writer.jats_archiving b/test/writer.jats_archiving
index d762c735a..31c619314 100644
--- a/test/writer.jats_archiving
+++ b/test/writer.jats_archiving
@@ -845,8 +845,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<graphic mimetype="image" mime-subtype="jpeg" xlink:href="lalune.jpg" xlink:title="Voyage dans la Lune" />
</fig>
<p>Here is a movie
- <inline-graphic mimetype="image" mime-subtype="jpeg" xlink:href="movie.jpg" />
- icon.</p>
+ <inline-graphic mimetype="image" mime-subtype="jpeg" xlink:href="movie.jpg">
+ <alt-text>movie</alt-text>
+ </inline-graphic> icon.</p>
</sec>
<sec id="footnotes">
<title>Footnotes</title>
diff --git a/test/writer.jats_articleauthoring b/test/writer.jats_articleauthoring
index 74d24754f..3bdb5c0ed 100644
--- a/test/writer.jats_articleauthoring
+++ b/test/writer.jats_articleauthoring
@@ -830,8 +830,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<graphic mimetype="image" mime-subtype="jpeg" xlink:href="lalune.jpg" xlink:title="Voyage dans la Lune" />
</fig>
<p>Here is a movie
- <inline-graphic mimetype="image" mime-subtype="jpeg" xlink:href="movie.jpg" />
- icon.</p>
+ <inline-graphic mimetype="image" mime-subtype="jpeg" xlink:href="movie.jpg">
+ <alt-text>movie</alt-text>
+ </inline-graphic> icon.</p>
</sec>
<sec id="footnotes">
<title>Footnotes</title>
diff --git a/test/writer.jats_publishing b/test/writer.jats_publishing
index 5701e5db8..6d7c7d68d 100644
--- a/test/writer.jats_publishing
+++ b/test/writer.jats_publishing
@@ -845,8 +845,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<graphic mimetype="image" mime-subtype="jpeg" xlink:href="lalune.jpg" xlink:title="Voyage dans la Lune" />
</fig>
<p>Here is a movie
- <inline-graphic mimetype="image" mime-subtype="jpeg" xlink:href="movie.jpg" />
- icon.</p>
+ <inline-graphic mimetype="image" mime-subtype="jpeg" xlink:href="movie.jpg">
+ <alt-text>movie</alt-text>
+ </inline-graphic> icon.</p>
</sec>
<sec id="footnotes">
<title>Footnotes</title>