diff options
Diffstat (limited to 'Text/Pandoc')
-rw-r--r-- | Text/Pandoc/Readers/Markdown.hs | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index e9befec12..6ff5ce17c 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -226,17 +226,32 @@ noteBlock = try $ do parseBlocks = manyTill block eof -block = choice [ header - , table - , codeBlock - , hrule - , list - , blockQuote - , rawLaTeXEnvironment' - , para - , htmlBlock - , plain - , nullBlock ] <?> "block" +block = do + st <- getState + choice (if stateStrict st + then [ header + , codeBlock + , hrule + , bulletList + , orderedList + , blockQuote + , htmlBlock + , para + , plain + , nullBlock ] + else [ header + , table + , codeBlock + , hrule + , bulletList + , orderedList + , definitionList + , blockQuote + , rawLaTeXEnvironment + , para + , htmlBlock + , plain + , nullBlock ]) <?> "block" -- -- header blocks @@ -314,8 +329,6 @@ blockQuote = do -- list blocks -- -list = choice [ bulletList, orderedList, definitionList ] <?> "list" - bulletListStart = try $ do optional newline -- if preceded by a Plain block in a list context nonindentSpaces @@ -434,7 +447,6 @@ defRawBlock = try $ do return $ firstline ++ "\n" ++ unlines rawlines ++ trailing definitionList = do - failIfStrict items <- many1 definitionListItem let (terms, defs) = unzip items let defs' = compactify defs @@ -503,12 +515,6 @@ rawHtmlBlocks = do return $ RawHtml combined' -- --- LaTeX --- - -rawLaTeXEnvironment' = failIfStrict >> rawLaTeXEnvironment - --- -- Tables -- @@ -629,7 +635,7 @@ alignType strLst len = (True, True) -> AlignCenter (False, False) -> AlignDefault -table = failIfStrict >> (simpleTable <|> multilineTable) <?> "table" +table = simpleTable <|> multilineTable <?> "table" -- -- inline |