Lua: re-add t and tag property to Attr values

Removal of these properties from Attr values was a regression.
This commit is contained in:
Albert Krewinkel 2021-10-27 22:24:39 +02:00
parent 25a86fc06f
commit 7fcf1d6184
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
2 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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