aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-09-26 19:31:10 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-09-26 19:31:10 +0300
commit2cdb8fe2e65aa13f91c9decd4e6cad97e87cc402 (patch)
tree5ef3568feabaf2b0aee2f29fe7da859e48899ae2
parent3fb3af75793686efa114352c3f0c33a4b4b71731 (diff)
downloadpandoc-2cdb8fe2e65aa13f91c9decd4e6cad97e87cc402.tar.gz
Muse reader: test metadata parsing
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs3
-rw-r--r--test/Tests/Readers/Muse.hs7
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index cf5fc0da2..6e7844d4b 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -150,8 +150,7 @@ parseDirective = do
key <- many letter
space
spaces
- raw <- many $ noneOf "\n"
- newline
+ raw <- manyTill anyChar eol
value <- parseFromString (trimInlinesF . mconcat <$> many inline) raw
return (key, value)
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index baa4df7fd..3088f88b3 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -689,4 +689,11 @@ tests =
, para "Third"
])
]
+ , testGroup "Meta"
+ [ "Title" =:
+ "#title Document title" =?>
+ let titleInline = toList $ "Document title"
+ meta = setMeta "title" (MetaInlines titleInline) $ nullMeta
+ in Pandoc meta mempty
+ ]
]