diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 2 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index ac19a2382..84121cabe 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -205,6 +205,8 @@ separator = try $ do header :: PandocMonad m => MuseParser m (F Blocks) header = try $ do + st <- stateParserContext <$> getState + getPosition >>= \pos -> guard (st == NullState && sourceColumn pos == 1) level <- liftM length $ many1 $ char '*' guard $ level <= 5 skipSpaces diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 85d6f5c48..cac69dffa 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -108,6 +108,12 @@ tests = , "Subsubsection" =: "***** Fifth level\n" =?> header 5 "Fifth level" + , "No headers below top level" =: + T.unlines [ "Foo[1]" + , "[1] * Bar" + ] =?> + para (text "Foo" <> + note (para "* Bar")) ] , testGroup "Footnotes" [ "Simple footnote" =: @@ -273,5 +279,16 @@ tests = , para "c" ] ] + -- Headers in first column of list continuation are not allowed + , "No headers in list continuation" =: + T.unlines + [ " - Foo" + , "" + , " * Bar" + ] =?> + bulletList [ mconcat [ para "Foo" + , para "* Bar" + ] + ] ] ] |