diff options
author | Hans-Peter Deifel <hpdeifel@gmx.de> | 2015-02-25 16:40:30 +0100 |
---|---|---|
committer | Hans-Peter Deifel <hpdeifel@gmx.de> | 2015-02-25 16:58:48 +0100 |
commit | 2ca510111349d2da8fabbd38e2dcb4bad923b6f2 (patch) | |
tree | 1b41794cc6cb512bae345425b06a8be93c52bca0 /src/Text | |
parent | ae3142f919a29900c8d53e486e02d40125b5a542 (diff) | |
download | pandoc-2ca510111349d2da8fabbd38e2dcb4bad923b6f2.tar.gz |
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>
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Org.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index f16aed48d..5b153b418 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -1106,7 +1106,7 @@ explicitOrImageLink = try $ do char ']' return $ do src <- srcF - if isImageFilename src && isImageFilename title + if isImageFilename title then pure $ B.link src "" $ B.image title mempty mempty else linkToInlinesF src =<< title' |