diff options
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/Attr.hs | 4 | ||||
-rw-r--r-- | test/lua/module/pandoc.lua | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs index 1b35e40ad..f69acc61e 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Attr.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Attr.hs @@ -56,6 +56,10 @@ typeAttr = deftype "Attr" ### return <#> parameter peekAttr "attr" "Attr" "" =#> functionResult pushAttr "Attr" "new Attr element" + , readonly "tag" "element type tag (always 'Attr')" + (pushText, const "Attr") + + , alias "t" "alias for `tag`" ["tag"] ] pushAttr :: LuaError e => Pusher e Attr diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 9b6e360f3..9d0663696 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -40,6 +40,13 @@ return { end ) }, + group 'Properties' { + test('has t and tag property', function () + local attr = pandoc.Attr('') + assert.are_equal(attr.t, 'Attr') + assert.are_equal(attr.tag, 'Attr') + end) + }, group 'AttributeList' { test('allows access via fields', function () local attributes = pandoc.Attr('', {}, {{'a', '1'}, {'b', '2'}}).attributes |