From 42a7b80c0479c83ed5300103a04545d5139f7a7e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 13 Jan 2019 16:51:15 +0100 Subject: data/pandoc.lua: auto-fix nested constructor arguments Incorrect types to pandoc element constructors are automatically converted to the correct types when possible. This was already done for most constructors, but conversions are now also done for nested types (like lists of lists). --- test/lua/smart-constructors.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/lua/smart-constructors.lua (limited to 'test/lua') diff --git a/test/lua/smart-constructors.lua b/test/lua/smart-constructors.lua new file mode 100644 index 000000000..6e579a12f --- /dev/null +++ b/test/lua/smart-constructors.lua @@ -0,0 +1,10 @@ +-- Test that constructors are "smart" in that they autoconvert +-- types where sensible. +function Para (_) + return { + pandoc.BulletList{pandoc.Para "Hello", pandoc.Para "World"}, + pandoc.DefinitionList{{"foo", pandoc.Para "placeholder"}}, + pandoc.LineBlock{"Moin", "Welt"}, + pandoc.OrderedList{pandoc.Plain{pandoc.Str "one"}, pandoc.Plain "two"} + } +end -- cgit v1.2.3