git.iko.soy/typeable/pandoc
on master help sign in
HTML reader: Ensure that paragraphs are closed properly...

when the parent block element closes, even without `</p>`. Closes #3794.

commit41209ea6765e9898d7e15c4c945c06275b6c0420 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 11 Jul 2017, 15:52 (9 years ago) parente6cdaea
2 files changed+9
src/Text/Pandoc/Readers/HTML.hs+2 test/command/3794.md+7
src/Text/Pandoc/Readers/HTML.hs+2
@@ -805,6 +805,8 @@ pCloses tagtype = try $ do
805805 (TagClose "dl") | tagtype == "dd" -> return ()
806806 (TagClose "table") | tagtype == "td" -> return ()
807807 (TagClose "table") | tagtype == "tr" -> return ()
808+ (TagClose t') | tagtype == "p" && t' `Set.member` blockHtmlTags
809+ -> return () -- see #3794
808810 _ -> mzero
809811
810812pTagText :: PandocMonad m => TagParser m Inlines
test/command/3794.mdnew file+7
@@ -0,0 +1,7 @@
1+```
2+% pandoc -f html -t native
3+<div><p>hello</div>
4+^D
5+[Div ("",[],[])
6+ [Para [Str "hello"]]]
7+```