diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-10-28 10:31:04 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-10-28 10:32:00 +0200 |
commit | af97598954f07c9762208ef16b03b86494d6b21e (patch) | |
tree | 25849f0bffc906606be47138b6f1d651a91f7e7d /src | |
parent | a1e422097aa62889e6d3d16f3ac9e214a1dcd70c (diff) | |
download | pandoc-af97598954f07c9762208ef16b03b86494d6b21e.tar.gz |
Lua: increase strictness when getting attribute keys
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/Attr.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs index f69acc61e..2f1f2406a 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Attr.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Attr.hs @@ -71,7 +71,7 @@ peekAttribs idx = liftLua (ltype idx) >>= \case TypeTable -> liftLua (rawlen idx) >>= \case 0 -> peekKeyValuePairs peekText peekText idx _ -> peekList (peekPair peekText peekText) idx - _ -> fail "unsupported type" + _ -> failPeek "unsupported type" pushAttribs :: LuaError e => Pusher e [(Text, Text)] pushAttribs = pushUD typeAttributeList @@ -139,7 +139,7 @@ peekAttribute idx = (AttributeValue <$!> peekText idx) lookupKey :: [(Text,Text)] -> Maybe Key -> Maybe Attribute lookupKey !kvs = \case - Just (StringKey str) -> AttributeValue <$> lookup str kvs + Just (StringKey str) -> AttributeValue <$!> lookup str kvs Just (IntKey n) -> AttributePair <$!> atMay kvs (n - 1) Nothing -> Nothing |