From 0fdac4984b61de9de07f730ea071ee2bb9f1076c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 19 Oct 2023 11:06:40 -0700 Subject: HTML reader: allow th to close td and vice versa. Closes #9090. --- src/Text/Pandoc/Readers/HTML/Parsing.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/HTML/Parsing.hs b/src/Text/Pandoc/Readers/HTML/Parsing.hs index 33af013f4..ac24aa70b 100644 --- a/src/Text/Pandoc/Readers/HTML/Parsing.hs +++ b/src/Text/Pandoc/Readers/HTML/Parsing.hs @@ -104,6 +104,8 @@ pCloses tagtype = try $ do t <- lookAhead $ pSatisfy $ \tag -> isTagClose tag || isTagOpen tag case t of (TagClose t') | t' == tagtype -> void pAny + (TagClose "th") | tagtype == "td" -> void pAny -- see #9090 + (TagClose "td") | tagtype == "th" -> void pAny (TagOpen t' _) | t' `closes` tagtype -> return () (TagClose "ul") | tagtype == "li" -> return () (TagClose "ol") | tagtype == "li" -> return () -- cgit v1.2.3