pandoc/test/lua
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
..
module Lua filters: allow passing of HTML-like tables instead of Attr (#5750) 2019-09-15 12:11:58 -07:00
attr-test.lua data/pandoc.lua: enable table-like behavior of attributes (#4080) 2017-11-20 09:37:40 -08:00
block-count.lua Text.Pandoc.Lua: support Inline and Block catch-alls 2017-08-22 23:30:48 +02:00
hello-world-doc.lua data/pandoc.lua: regularize constructors. 2017-06-29 17:08:59 +02:00
implicit-doc-filter.lua data/pandoc.lua: regularize constructors. 2017-06-29 17:08:59 +02:00
markdown-reader.lua Lua module: provide simple read format parser 2017-04-26 23:28:40 +02:00
math.lua Test Lua filter converting display math to inline math 2018-04-29 16:20:38 +03:00
metatable-catch-all.lua Text.Pandoc.Lua: respect metatable when getting filters 2017-08-22 22:56:51 +02:00
plain-to-para.lua Lua filter: revert to non-destructuring filters 2017-04-15 21:40:48 +02:00
script-name.lua Lua: register script name in global variable 2018-02-24 22:43:28 +01:00
single-to-double-quoted.lua Lua filters: Remove special treatment of Quoted, Math. 2017-06-29 15:47:27 +02:00
smallcaps-title.lua Lua filter: allow filtering of meta data only 2017-04-26 23:28:40 +02:00
smart-constructors.lua data/pandoc.lua: auto-fix nested constructor arguments 2019-01-13 17:14:10 +01:00
strmacro.lua Lua filter: revert to non-destructuring filters 2017-04-15 21:40:48 +02:00
undiv.lua Allow lua filters to return lists of elements 2017-09-24 12:04:15 -07:00
uppercase-header.lua Lua filters: preload text module (#4077) 2017-11-18 13:24:06 -08:00