diff options
| author | Julia Diaz <julia.diaz@gmail.com> | 2023-10-17 17:16:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-17 09:16:00 -0700 |
| commit | fa3513b104e089a8969f3ae0dab98eba78b1a942 (patch) | |
| tree | f1d89ccbf6ee52fd22ec6cc77e161da2403a54cb /test/Tests | |
| parent | 802c610923b364a4a10f59eccb5f1d0b7176ab53 (diff) | |
JATS reader: fix handling of alt-text (#9134)
Previously we were looking for an attribute that doesn't exist in
JATS; alt-text is provided by a child element.
Closes #9130.
Diffstat (limited to 'test/Tests')
| -rw-r--r-- | test/Tests/Readers/JATS.hs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/Tests/Readers/JATS.hs b/test/Tests/Readers/JATS.hs index b7d36dc00..7a49d5e12 100644 --- a/test/Tests/Readers/JATS.hs +++ b/test/Tests/Readers/JATS.hs @@ -35,6 +35,42 @@ tests = [ testGroup "inline code" , testGroup "images" [ test jats "basic" $ "<graphic mimetype=\"image\" mime-subtype=\"\" xlink:href=\"/url\" xlink:title=\"title\" />" =?> para (image "/url" "title" mempty) + , test jats "alt-text" $ + "<graphic id=\"graphic001\"\n\ + \ xlink:href=\"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n\ + \ xlink:title=\"This is the title of the graphic\"\n\ + \ xlink:role=\"This is the role of the graphic\">\n\ + \ <alt-text>Alternative text of the graphic</alt-text>\n\ + \ <caption>\n\ + \ <title>This is the title of the caption</title>\n\ + \ <p>Google doodle from 14 March 2003</p></caption>\n\ + \ </graphic>" + =?> Para [ Image + ( "graphic001" + , [ "This" + , "is" + , "the" + , "role" + , "of" + , "the" + , "graphic" + ] + , [] + ) + [ Str "Alternative" + , Space + , Str "text" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "graphic" + ] + ( "https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660" + , "This is the title of the graphic" + ) + ] ] , test jats "bullet list" $ "<list list-type=\"bullet\">\n\ |
