aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-10-19 11:06:40 -0700
committerJohn MacFarlane <[email protected]>2023-10-19 11:07:22 -0700
commit0fdac4984b61de9de07f730ea071ee2bb9f1076c (patch)
tree7eada91460ff3f762955e1f35899cf1bfbf865f9 /src
parent1529ff45e665e21623127561e7b8ce576b56de5c (diff)
HTML reader: allow th to close td and vice versa.
Closes #9090.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/HTML/Parsing.hs2
1 files changed, 2 insertions, 0 deletions
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 ()