aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorMauro Bieg <mb21@users.noreply.github.com>2016-12-24 22:41:54 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-12-24 14:41:54 -0700
commit9b29a55d9bdf561405bc1021011bf67d24ee0c96 (patch)
treea23e6bec4433c552c3a6082b549a602b6ad6848a /src/Text
parent8f09a2b0107069bc3301d91d642bde858031149e (diff)
downloadpandoc-9b29a55d9bdf561405bc1021011bf67d24ee0c96.tar.gz
HTML writer: don't process pars with empty RawInline, fixes #1040 (#3327)
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs11
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