From c0caaaeabb3646d6156a0857e250969b4244cdc5 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 1 Jan 2019 20:53:52 +0100 Subject: 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 --- test/Tests/Readers/Org/Inline.hs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'test/Tests/Readers') 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" -- cgit v1.2.3