aboutsummaryrefslogtreecommitdiff
path: root/test/lua/module/pandoc.lua
AgeCommit message (Collapse)AuthorFilesLines
2019-09-15Lua filters: allow passing of HTML-like tables instead of Attr (#5750)Albert Krewinkel1-0/+41
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-08-16Lua: traverse nested blocks and inlines in correct orderAlbert Krewinkel1-0/+38
Traversal methods are updated to use the new Walk module such that sequences with nested Inline (or Block) elements are traversed in the order in which they appear in the linearized document. Fixes: #5667
2019-06-12Lua: add a `clone()` method to all AST elements (#5572)Albert Krewinkel1-0/+38
Closes: #5568
2019-06-11test/lua/module/pandoc.lua: fix non-determinism in testAlbert Krewinkel1-4/+11
2019-06-11data/pandoc.lua: fix deletion of nonexistent attributesAlbert Krewinkel1-0/+6
Fixes: #5569
2019-06-11Lua pandoc module: better tests for Attr and AttributeListAlbert Krewinkel1-0/+65
2019-05-20Improve output of Lua tests (#5499)Albert Krewinkel1-0/+58
This makes use of tasty-lua, a package to write tests in Lua and integrate the results into Tasty output. Test output becomes more informative: individual tests and test groups become visible in test output. Failures are reported with helpful error messages.