From 446cf6a1cfed364dfc0d01b39697ffde2310109d Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Sat, 21 May 2016 23:05:00 -0700
Subject: [PATCH] HTML reader: fixed bug in pClose.

This caused exponential parsing behavior in documnets
with unclosed tags in dl, dd, dt.
---
 src/Text/Pandoc/Readers/HTML.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 8ee5da543..164e3a98f 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -707,7 +707,7 @@ pCloses tagtype = try $ do
        (TagOpen t' _) | t' `closes` tagtype -> return ()
        (TagClose "ul") | tagtype == "li" -> return ()
        (TagClose "ol") | tagtype == "li" -> return ()
-       (TagClose "dl") | tagtype == "li" -> return ()
+       (TagClose "dl") | tagtype == "dd" -> return ()
        (TagClose "table") | tagtype == "td" -> return ()
        (TagClose "table") | tagtype == "tr" -> return ()
        _ -> mzero