Org reader: Allow image links with non-image targets
Org-Mode's own html exporter converts the following org link:
[[http://example.com][https://www.haskell.org/static/img/logo.png]]
to
<a href="http://example.com">
<img src="https://www.haskell.org/static/img/logo.png" alt="logo.png" />
</a>
but pandoc generates:
<a href="http://example.com">
<a href="https://www.haskell.org/static/img/logo.png" class="uri">
https://www.haskell.org/static/img/logo.png
</a>
</a>
which is useless. With this patch, it generates:
<a href="http://example.com">
<img src="https://www.haskell.org/static/img/logo.png" alt="" />
</a>
commit2ca510111349d2da8fabbd38e2dcb4bad923b6f2
authorHans-Peter Deifel <hpdeifel@gmx.de>
dateWed 25 Feb 2015, 16:40 (12 years ago)
parentae3142f
src/Text/Pandoc/Readers/Org.hs+1−1
@@ -1106,7 +1106,7 @@ explicitOrImageLink = try $ do
11061106 char ']'
11071107 return $ do
11081108 src <- srcF
1109− if isImageFilename src && isImageFilename title
1109+ if isImageFilename title
11101110 then pure $ B.link src "" $ B.image title mempty mempty
11111111 else linkToInlinesF src =<< title'
11121112