diff options
| -rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 58762c35f..f3c3b9882 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -600,7 +600,9 @@ orderedList = try $ do                                            _              -> DefaultStyle                                return (read sta, sty')    spaces -  items <- sepEndBy1 (blocksIn "li") spaces +  -- note: if they have an <ol> or <ul> not in scope of a <li>, +  -- treat it as a list item, though it's not valid xhtml... +  items <- sepEndBy1 (blocksIn "li" <|> liftM (:[]) list) spaces    htmlEndTag "ol"    return $ OrderedList (start, style, DefaultDelim) items @@ -608,7 +610,9 @@ bulletList :: GenParser Char ParserState Block  bulletList = try $ do    htmlTag "ul"    spaces -  items <- sepEndBy1 (blocksIn "li") spaces +  -- note: if they have an <ol> or <ul> not in scope of a <li>, +  -- treat it as a list item, though it's not valid xhtml... +  items <- sepEndBy1 (blocksIn "li" <|> liftM (:[]) list) spaces    htmlEndTag "ul"    return $ BulletList items | 
