git.iko.soy/typeable/pandoc
on master help sign in
PDF: Don't crash with nonexistent image.

Instead, emit the alt text, emphasized. This accords with what the ODT writer currently does. The user will still get a warning about a nonexistent image, but will no longer get a LaTeX crash. Closes #3100.

commitb0013bfb13494648886e50840ccdd850c95c9d19 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 2 Sep 2016, 11:44 (10 years ago) parent07c67cf
1 file changed+2−1
src/Text/Pandoc/PDF.hs+2−1
src/Text/Pandoc/PDF.hs+2−1
@@ -131,7 +131,8 @@ handleImage' opts tmpdir (Image attr ils (src,tit)) = do
131131 return $ Image attr ils (fname,tit)
132132 _ -> do
133133 warn $ "Could not find image `" ++ src ++ "', skipping..."
134− return $ Image attr ils (src,tit)
134+ -- return alt text
135+ return $ Emph ils
135136handleImage' _ _ x = return x
136137
137138convertImages :: FilePath -> Inline -> IO Inline