aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-26 23:18:32 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-26 23:18:32 -0800
commitde7902154377c6a93eeb91d95d2a27e794cac683 (patch)
tree5c27b49c2b4cf60036276b7859a23d533002d4bc /src
parentdd96267626e6f52e49c912cfe90380de2df469e5 (diff)
downloadpandoc-de7902154377c6a93eeb91d95d2a27e794cac683.tar.gz
EPUB writer: Make external (absolute) links active.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 55da4554d..cd4b3fce6 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -46,7 +46,7 @@ import Text.Pandoc.UUID
import Text.Pandoc.Writers.HTML
import Text.Pandoc.Writers.Markdown ( writePlain )
import Data.Char ( toLower )
-import Network.URI ( unEscapeString )
+import Network.URI ( unEscapeString, isRelativeReference )
-- | Produce an EPUB file from a Pandoc document.
writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line
@@ -271,7 +271,7 @@ transformInlines (MathML _) _ _ (x@(Math _ _) : xs) = do
result = if "<math" `isPrefixOf` mathml then inOps else mathml
return $ RawInline "html" result : xs
transformInlines _ _ _ (RawInline _ _ : xs) = return $ Str "" : xs
-transformInlines _ _ _ (Link lab (_,_) : xs) = return $ lab ++ xs
+transformInlines _ _ _ (Link lab (src,_) : xs) | isRelativeReference src = return $ lab ++ xs
transformInlines _ _ _ xs = return xs
transformBlock :: Block -> Block