From 0c21e4342c50f8d2f039035a6ed315a5ed957cc9 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Fri, 12 Feb 2010 02:47:24 +0000 Subject: HTML reader: Be forgiving in parsing a bare list within a list. The following is not valid xhtml, but the intent is clear:
  1. one
    1. sub
  2. two
We'll treat the
    as if it's in a
  1. . Resolves Issue #215. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1836 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/HTML.hs | 8 ++++++-- 1 file 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
      or
        not in scope of a
      • , + -- 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
          or
            not in scope of a
          • , + -- treat it as a list item, though it's not valid xhtml... + items <- sepEndBy1 (blocksIn "li" <|> liftM (:[]) list) spaces htmlEndTag "ul" return $ BulletList items -- cgit v1.2.3