From 9b29a55d9bdf561405bc1021011bf67d24ee0c96 Mon Sep 17 00:00:00 2001 From: Mauro Bieg Date: Sat, 24 Dec 2016 22:41:54 +0100 Subject: HTML writer: don't process pars with empty RawInline, fixes #1040 (#3327) --- src/Text/Pandoc/Writers/HTML.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 9581702a7..3c8c264d2 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -451,9 +451,14 @@ blockToHtml opts (Para [Image attr txt (s,'f':'i':'g':':':tit)]) = do [nl opts, img, capt, nl opts] else H.div ! A.class_ "figure" $ mconcat [nl opts, img, nl opts, capt, nl opts] -blockToHtml opts (Para lst) = do - contents <- inlineListToHtml opts lst - return $ H.p contents +blockToHtml opts (Para lst) + | isEmptyRaw lst = return mempty + | otherwise = do + contents <- inlineListToHtml opts lst + return $ H.p contents + where + isEmptyRaw [RawInline f _] = f /= (Format "html") + isEmptyRaw _ = False blockToHtml opts (LineBlock lns) = if writerWrapText opts == WrapNone then blockToHtml opts $ linesToPara lns -- cgit v1.2.3