diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2019-09-15 21:11:58 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-09-15 12:11:58 -0700 |
commit | d0261d7387cdf1a910a1029a747e239453190f71 (patch) | |
tree | f420021bdd6dc101054c5c9f17095cc8bf0620c8 /tools/pandoc-template-mode.el | |
parent | f580da203382efbb3c1cc8da37eacd27025034d7 (diff) | |
download | pandoc-d0261d7387cdf1a910a1029a747e239453190f71.tar.gz |
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
Diffstat (limited to 'tools/pandoc-template-mode.el')
0 files changed, 0 insertions, 0 deletions