Metadata.hs (pandoc-2.11.1.1) | : | Metadata.hs (pandoc-2.11.2) | ||
---|---|---|---|---|
skipping to change at line 114 | skipping to change at line 114 | |||
nodeToKey _ = Nothing | nodeToKey _ = Nothing | |||
normalizeMetaValue :: PandocMonad m | normalizeMetaValue :: PandocMonad m | |||
=> ParserT Text ParserState m (F MetaValue) | => ParserT Text ParserState m (F MetaValue) | |||
-> Text | -> Text | |||
-> ParserT Text ParserState m (F MetaValue) | -> ParserT Text ParserState m (F MetaValue) | |||
normalizeMetaValue pMetaValue x = | normalizeMetaValue pMetaValue x = | |||
-- Note: a standard quoted or unquoted YAML value will | -- Note: a standard quoted or unquoted YAML value will | |||
-- not end in a newline, but a "block" set off with | -- not end in a newline, but a "block" set off with | |||
-- `|` or `>` will. | -- `|` or `>` will. | |||
if "\n" `T.isSuffixOf` x | if "\n" `T.isSuffixOf` T.dropWhileEnd isSpaceChar x -- see #6823 | |||
then parseFromString' pMetaValue (x <> "\n") | then parseFromString' pMetaValue (x <> "\n") | |||
else parseFromString' asInlines x | else parseFromString' asInlines x | |||
where asInlines = fmap b2i <$> pMetaValue | where asInlines = fmap b2i <$> pMetaValue | |||
b2i (MetaBlocks [Plain ils]) = MetaInlines ils | b2i (MetaBlocks [Plain ils]) = MetaInlines ils | |||
b2i (MetaBlocks [Para ils]) = MetaInlines ils | b2i (MetaBlocks [Para ils]) = MetaInlines ils | |||
b2i bs = bs | b2i bs = bs | |||
isSpaceChar ' ' = True | ||||
isSpaceChar '\t' = True | ||||
isSpaceChar _ = False | ||||
checkBoolean :: Text -> Maybe Bool | checkBoolean :: Text -> Maybe Bool | |||
checkBoolean t | checkBoolean t | |||
| t == T.pack "true" || t == T.pack "True" || t == T.pack "TRUE" = Just True | | t == T.pack "true" || t == T.pack "True" || t == T.pack "TRUE" = Just True | |||
| t == T.pack "false" || t == T.pack "False" || t == T.pack "FALSE" = Just Fal se | | t == T.pack "false" || t == T.pack "False" || t == T.pack "FALSE" = Just Fal se | |||
| otherwise = Nothing | | otherwise = Nothing | |||
yamlToMetaValue :: PandocMonad m | yamlToMetaValue :: PandocMonad m | |||
=> ParserT Text ParserState m (F MetaValue) | => ParserT Text ParserState m (F MetaValue) | |||
-> YAML.Node YE.Pos | -> YAML.Node YE.Pos | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added |