diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Org.hs | 2 | ||||
-rw-r--r-- | tests/Tests/Readers/Org.hs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index 1dfbdd700..fc63cc11e 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -1093,7 +1093,7 @@ explicitOrImageLink = try $ do char ']' alt <- internalLink src title' return $ - (if isImageFilename src && isImageFilename title + (if isImageFilename title then B.link src "" $ B.image title mempty mempty else fromMaybe alt (linkToInlines src title')) diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index f555447c7..4cec54a68 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -216,6 +216,10 @@ tests = "[[sunset.png][dusk.svg]]" =?> (para $ link "sunset.png" "" (image "dusk.svg" "" "")) + , "Image link with non-image target" =: + "[[http://example.com][logo.png]]" =?> + (para $ link "http://example.com" "" (image "logo.png" "" "")) + , "Plain link" =: "Posts on http://zeitlens.com/ can be funny at times." =?> (para $ spcSep [ "Posts", "on" |