d0261d7387
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 |
||
---|---|---|
.. | ||
module | ||
attr-test.lua | ||
block-count.lua | ||
hello-world-doc.lua | ||
implicit-doc-filter.lua | ||
markdown-reader.lua | ||
math.lua | ||
metatable-catch-all.lua | ||
plain-to-para.lua | ||
script-name.lua | ||
single-to-double-quoted.lua | ||
smallcaps-title.lua | ||
smart-constructors.lua | ||
strmacro.lua | ||
undiv.lua | ||
uppercase-header.lua |