diff options
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 | ||||
-rw-r--r-- | test/lua/module/pandoc.lua | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 469dd4285..4363f7e4f 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -710,7 +710,7 @@ typeInline = deftype "Inline" (pushPandocList pushInline, \case Image _ capt _ -> Actual capt _ -> Absent) - (peekInlines, \case + (peekInlinesFuzzy, \case Image attr _ target -> Actual . (\capt -> Image attr capt target) _ -> const Absent) , possibleProperty "citations" "list of citations" diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 9f5f5c771..be1cbbde1 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -191,6 +191,15 @@ return { assert.are_equal(pandoc.Code('1 + 1'), code) end), }, + group 'Image' { + test('has property `caption`', function () + local img = pandoc.Image('example', 'a.png') + assert.are_same(img.caption, {pandoc.Str 'example'}) + + img.caption = {pandoc.Str 'A'} + assert.are_equal(img, pandoc.Image({pandoc.Str 'A'}, 'a.png')) + end), + }, group 'Link' { test('has property `content`', function () local link = pandoc.Link('example', 'https://example.org') |