git.iko.soy/typeable/pandoc
on master help sign in
HTML reader: td or th implicitly closes blocks within last td/th.
commitd2c4243f89a6368d4f9f8a511d9b026d0be19cd8 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 24 Oct 2017, 14:27 (9 years ago) parent513b16a
1 file changed+5−1
src/Text/Pandoc/Readers/HTML.hs+5−1
src/Text/Pandoc/Readers/HTML.hs+5−1
@@ -1036,7 +1036,11 @@ _ `closes` "html" = False
10361036"body" `closes` "head" = True
10371037"a" `closes` "a" = True
10381038"li" `closes` "li" = True
1039−"th" `closes` t | t `elem` ["th","td"] = True
1039+t1 `closes` t2
1040+ | t1 `elem` ["th","td"] &&
1041+ t2 `Set.member` blockTags &&
1042+ t2 /= "tr" &&
1043+ t2 /= "table" = True
10401044"tr" `closes` t | t `elem` ["th","td","tr"] = True
10411045"dd" `closes` t | t `elem` ["dt", "dd"] = True
10421046"dt" `closes` t | t `elem` ["dt","dd"] = True