@@ -235,9 +235,9 @@ block = choice [ header
235235 , hrule
236236 , list
237237 , blockQuote
238− , htmlBlock
239238 , rawLaTeXEnvironment'
240239 , para
240+ , htmlBlock
241241 , plain
242242 , nullBlock ] <?> "block"
243243
@@ -448,8 +448,16 @@ definitionList = do
448448-- paragraph block
449449--
450450
451+isHtmlOrBlank (HtmlInline _) = True
452+isHtmlOrBlank (Space) = True
453+isHtmlOrBlank (LineBreak) = True
454+isHtmlOrBlank _ = False
455+
451456para = try $ do
452457 result <- many1 inline
458+ if all isHtmlOrBlank result
459+ then fail "treat as raw HTML"
460+ else return ()
453461 newline
454462 blanklines <|> do st <- getState
455463 if stateStrict st
@@ -886,8 +894,8 @@ rawLaTeXInline' = failIfStrict >> rawLaTeXInline
886894
887895rawHtmlInline' = do
888896 st <- getState
889− result <- choice $ if stateStrict st
890− then [htmlBlockElement, anyHtmlTag, anyHtmlEndTag]
891− else [htmlBlockElement, anyHtmlInlineTag]
897+ result <- if stateStrict st
898+ then choice [htmlBlockElement, anyHtmlTag, anyHtmlEndTag]
899+ else anyHtmlInlineTag
892900 return $ HtmlInline result
893901