git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #1519 from mpickering/more
95d9b43John MacFarlane
src/Text/Pandoc/Readers/EPUB.hs+1−1
@@ -95,7 +95,7 @@ fetchImages mimes root arc (query iq -> links) =
95 (mapMaybe getEntry links)
95 (mapMaybe getEntry links)
96 where
96 where
97 getEntry link =
97 getEntry link =
98− let abslink = root </> link in
98+ let abslink = normalise (root </> link) in
99 (link , lookup link mimes, ) . fromEntry
99 (link , lookup link mimes, ) . fromEntry
100 <$> findEntryByPath abslink arc
100 <$> findEntryByPath abslink arc
101
101
src/Text/Pandoc/Writers/LaTeX.hs+7−2
@@ -303,12 +303,17 @@ isLineBreakOrSpace _ = False
303blockToLaTeX :: Block -- ^ Block to convert
303blockToLaTeX :: Block -- ^ Block to convert
304 -> State WriterState Doc
304 -> State WriterState Doc
305blockToLaTeX Null = return empty
305blockToLaTeX Null = return empty
306−blockToLaTeX (Div (_,classes,_) bs) = do
306+blockToLaTeX (Div (identifier,classes,_) bs) = do
307 beamer <- writerBeamer `fmap` gets stOptions
307 beamer <- writerBeamer `fmap` gets stOptions
308+ ref <- toLabel identifier
309+ let linkAnchor = if null identifier
310+ then empty
311+ else "\\hyperdef{}" <> braces (text ref) <>
312+ braces ("\\label" <> braces (text ref))
308 contents <- blockListToLaTeX bs
313 contents <- blockListToLaTeX bs
309 if beamer && "notes" `elem` classes -- speaker notes
314 if beamer && "notes" `elem` classes -- speaker notes
310 then return $ "\\note" <> braces contents
315 then return $ "\\note" <> braces contents
311− else return contents
316+ else return (linkAnchor <> contents)
312blockToLaTeX (Plain lst) =
317blockToLaTeX (Plain lst) =
313 inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
318 inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
314-- title beginning with fig: indicates that the image is a figure
319-- title beginning with fig: indicates that the image is a figure