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:
parent
25a86fc06f
commit
7fcf1d6184
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue