diff options
author | Mauro Bieg <mb21@users.noreply.github.com> | 2016-12-24 22:41:54 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-12-24 14:41:54 -0700 |
commit | 9b29a55d9bdf561405bc1021011bf67d24ee0c96 (patch) | |
tree | a23e6bec4433c552c3a6082b549a602b6ad6848a /src/Text/Pandoc | |
parent | 8f09a2b0107069bc3301d91d642bde858031149e (diff) | |
download | pandoc-9b29a55d9bdf561405bc1021011bf67d24ee0c96.tar.gz |
HTML writer: don't process pars with empty RawInline, fixes #1040 (#3327)
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 11 |
1 files changed, 8 insertions, 3 deletions
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 |