@@ -665,16 +665,11 @@ blockToHtml opts (Para [Image attr@(_,classes,_) txt (src,tit)])
665665-- title beginning with fig: indicates that the image is a figure
666666blockToHtml opts (Para [Image attr txt (s,'f':'i':'g':':':tit)]) =
667667 figure opts attr txt (s,tit)
668−blockToHtml opts (Para lst)
669− | isEmptyRaw lst = return mempty
670− | null lst && not (isEnabled Ext_empty_paragraphs opts) = return mempty
671− | otherwise = do
672− contents <- inlineListToHtml opts lst
673− return $ H.p contents
674− where
675− isEmptyRaw [RawInline f _] = f `notElem` [Format "html",
676− Format "html4", Format "html5"]
677− isEmptyRaw _ = False
668+blockToHtml opts (Para lst) = do
669+ contents <- inlineListToHtml opts lst
670+ case contents of
671+ Empty _ | not (isEnabled Ext_empty_paragraphs opts) -> return mempty
672+ _ -> return $ H.p contents
678673blockToHtml opts (LineBlock lns) =
679674 if writerWrapText opts == WrapNone
680675 then blockToHtml opts $ linesToPara lns
@@ -1063,7 +1058,6 @@ inlineToHtml opts inline = do
10631058 if ishtml
10641059 then return $ preEscapedString str
10651060 else if (f == Format "latex" || f == Format "tex") &&
1066− "\\begin" `isPrefixOf` str &&
10671061 allowsMathEnvironments (writerHTMLMathMethod opts) &&
10681062 isMathEnvironment str
10691063 then inlineToHtml opts $ Math DisplayMath str