diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Org/Meta.hs | 2 | ||||
-rw-r--r-- | tests/Tests/Readers/Org.hs | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs index 372b19fb6..91d16fc63 100644 --- a/src/Text/Pandoc/Readers/Org/Meta.hs +++ b/src/Text/Pandoc/Readers/Org/Meta.hs @@ -59,7 +59,7 @@ declarationLine = try $ do value <- metaValue key updateState $ \st -> let meta' = B.setMeta key <$> value <*> pure nullMeta - in st { orgStateMeta = orgStateMeta st <> meta' } + in st { orgStateMeta = meta' <> orgStateMeta st } metaKey :: OrgParser String metaKey = map toLower <$> many1 (noneOf ": \n\r") diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 844266401..5bb291d45 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -496,6 +496,14 @@ tests = ] =?> (mempty::Blocks) + , "later meta definitions take precedence" =: + unlines [ "#+AUTHOR: this will not be used" + , "#+author: Max" + ] =?> + let author = MetaInlines [Str "Max"] + meta = setMeta "author" (MetaList [author]) $ nullMeta + in Pandoc meta mempty + , "Logbook drawer" =: unlines [ " :LogBook:" , " - State \"DONE\" from \"TODO\" [2014-03-03 Mon 11:00]" |