aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Readers/Org
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2019-01-01 20:53:52 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2019-01-01 21:03:38 +0100
commitc0caaaeabb3646d6156a0857e250969b4244cdc5 (patch)
tree0f2c65327954685d5a8b09ce0c15ce33b9d060fd /test/Tests/Readers/Org
parentaf887e9198b2192daac4827923ea319892ad5bdd (diff)
downloadpandoc-c0caaaeabb3646d6156a0857e250969b4244cdc5.tar.gz
Org reader: fix treatment of links to images
Links with descriptions which are pointing to images are no longer read as inline images, but as proper links. Fixes: #5191
Diffstat (limited to 'test/Tests/Readers/Org')
-rw-r--r--test/Tests/Readers/Org/Inline.hs30
1 files changed, 17 insertions, 13 deletions
diff --git a/test/Tests/Readers/Org/Inline.hs b/test/Tests/Readers/Org/Inline.hs
index 9cfcda79f..7f8873642 100644
--- a/test/Tests/Readers/Org/Inline.hs
+++ b/test/Tests/Readers/Org/Inline.hs
@@ -184,26 +184,26 @@ tests =
, testGroup "Images"
[ "Image" =:
- "[[./sunset.jpg]]" =?>
- para (image "./sunset.jpg" "" "")
+ "[[./sunset.jpg]]" =?>
+ para (image "./sunset.jpg" "" "")
, "Image with explicit file: prefix" =:
- "[[file:sunrise.jpg]]" =?>
- para (image "sunrise.jpg" "" "")
+ "[[file:sunrise.jpg]]" =?>
+ para (image "sunrise.jpg" "" "")
, "Multiple images within a paragraph" =:
- T.unlines [ "[[file:sunrise.jpg]]"
- , "[[file:sunset.jpg]]"
- ] =?>
- para ((image "sunrise.jpg" "" "")
+ T.unlines [ "[[file:sunrise.jpg]]"
+ , "[[file:sunset.jpg]]"
+ ] =?>
+ para (image "sunrise.jpg" "" ""
<> softbreak
- <> (image "sunset.jpg" "" ""))
+ <> image "sunset.jpg" "" "")
, "Image with html attributes" =:
- T.unlines [ "#+ATTR_HTML: :width 50%"
- , "[[file:guinea-pig.gif]]"
- ] =?>
- para (imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
+ T.unlines [ "#+ATTR_HTML: :width 50%"
+ , "[[file:guinea-pig.gif]]"
+ ] =?>
+ para (imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
]
, "Explicit link" =:
@@ -235,6 +235,10 @@ tests =
"[[http://example.com][./logo.png]]" =?>
para (link "http://example.com" "" (image "./logo.png" "" ""))
+ , "Link to image" =:
+ "[[https://example.com/image.jpg][Look!]]" =?>
+ para (link "https://example.com/image.jpg" "" (str "Look!"))
+
, "Plain link" =:
"Posts on http://zeitlens.com/ can be funny at times." =?>
para (spcSep [ "Posts", "on"