pandoc/test/lua/module
Albert Krewinkel d0261d7387 Lua filters: allow passing of HTML-like tables instead of Attr (#5750)
Attr values can now be given as normal Lua tables; this can be used as a
convenient alternative to define Attr values, instead of constructing
values with `pandoc.Attr`. Identifiers are taken from the *id* field,
classes must be given as space separated words in the *class* field. All
remaining fields are included as misc attributes.

With this change, the following lines now create equal elements:

    pandoc.Span('test', {id = 'test', class = 'a b', check = 1})
    pandoc.Span('test', pandoc.Attr('test', {'a','b'}, {check = 1}))

This also works when using the *attr* setter:

    local span = pandoc.Span 'text'
    span.attr = {id = 'test', class = 'a b', check = 1}

Furthermore, the *attributes* field of AST elements can now be a plain
key-value table even when using the `attributes` accessor:

    local span = pandoc.Span 'test'
    span.attributes = {check = 1}   -- works as expected now

Closes: #5744
2019-09-15 12:11:58 -07:00
..
pandoc-mediabag.lua Lua modules: test pandoc.mediabag 2019-05-30 08:44:40 +02:00
pandoc-types.lua Lua Version type: shorten "version too old" message 2019-05-29 22:59:45 +02:00
pandoc-utils.lua Replace Element and makeHierarchical with makeSections. 2019-09-08 22:20:19 -07:00
pandoc.lua Lua filters: allow passing of HTML-like tables instead of Attr (#5750) 2019-09-15 12:11:58 -07:00