git.iko.soy/typeable/pandoc
on master help sign in
Org reader: Fix distinction of images and normal links

Fixed a false assumption about the precedence of (&&) vs (||).

commita69416091ba035ab1661ff306ef3e51fd926488b authorAlbert Krewinkel <tarleb@moltkeplatz.de> dateSat 19 Apr 2014, 11:25 (13 years ago) parent6ded3d4
1 file changed+2−2
src/Text/Pandoc/Readers/Org.hs+2−2
src/Text/Pandoc/Readers/Org.hs+2−2
@@ -860,8 +860,8 @@ linkTarget = enclosed (char '[') (char ']') (noneOf "\n\r]")
860860isImageFilename :: String -> Bool
861861isImageFilename filename =
862862 any (\x -> ('.':x) `isSuffixOf` filename) imageExtensions &&
863− any (\x -> (x++":") `isPrefixOf` filename) protocols ||
864− ':' `notElem` filename
863+ (any (\x -> (x++":") `isPrefixOf` filename) protocols ||
864+ ':' `notElem` filename)
865865 where
866866 imageExtensions = [ "jpeg" , "jpg" , "png" , "gif" , "svg" ]
867867 protocols = [ "file", "http", "https" ]