From 550fe44f950543715f591dc6bb8987747dd1d44d Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 10 Aug 2025 10:51:14 +0200 Subject: T.P.Writers.Shared: amend docs of `lookupMeta...` functions. Add notes to the Haddock docs that certain meta values lead to empty return values. Closes: #10634 --- src/Text/Pandoc/Writers/Shared.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs index a24be9a13..aff1520f1 100644 --- a/src/Text/Pandoc/Writers/Shared.hs +++ b/src/Text/Pandoc/Writers/Shared.hs @@ -568,6 +568,8 @@ lookupMetaBool key meta = -- | Retrieve the metadata value for a given @key@ -- and extract blocks. +-- +-- Note that an empty list is returned for maps, lists, and booleans. lookupMetaBlocks :: Text -> Meta -> [Block] lookupMetaBlocks key meta = case lookupMeta key meta of @@ -578,6 +580,8 @@ lookupMetaBlocks key meta = -- | Retrieve the metadata value for a given @key@ -- and extract inlines. +-- +-- Note that an empty list is returned for maps and lists. lookupMetaInlines :: Text -> Meta -> [Inline] lookupMetaInlines key meta = case lookupMeta key meta of @@ -589,6 +593,8 @@ lookupMetaInlines key meta = -- | Retrieve the metadata value for a given @key@ -- and convert to String. +-- +-- Note that an empty list is returned for maps, lists, and booleans. lookupMetaString :: Text -> Meta -> Text lookupMetaString key meta = case lookupMeta key meta of -- cgit v1.2.3