git.iko.soy/typeable/pandoc
on master help sign in
EPUB writer: Make external (absolute) links active.
commitde7902154377c6a93eeb91d95d2a27e794cac683 authorJohn MacFarlane <fiddlosopher@gmail.com> dateMon 26 Dec 2011, 23:18 (15 years ago) parentdd96267
1 file changed+2−2
src/Text/Pandoc/Writers/EPUB.hs+2−2
src/Text/Pandoc/Writers/EPUB.hs+2−2
@@ -46,7 +46,7 @@ import Text.Pandoc.UUID
4646import Text.Pandoc.Writers.HTML
4747import Text.Pandoc.Writers.Markdown ( writePlain )
4848import Data.Char ( toLower )
49−import Network.URI ( unEscapeString )
49+import Network.URI ( unEscapeString, isRelativeReference )
5050
5151-- | Produce an EPUB file from a Pandoc document.
5252writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line
@@ -271,7 +271,7 @@ transformInlines (MathML _) _ _ (x@(Math _ _) : xs) = do
271271 result = if "<math" `isPrefixOf` mathml then inOps else mathml
272272 return $ RawInline "html" result : xs
273273transformInlines _ _ _ (RawInline _ _ : xs) = return $ Str "" : xs
274−transformInlines _ _ _ (Link lab (_,_) : xs) = return $ lab ++ xs
274+transformInlines _ _ _ (Link lab (src,_) : xs) | isRelativeReference src = return $ lab ++ xs
275275transformInlines _ _ _ xs = return xs
276276
277277transformBlock :: Block -> Block