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).
This commit is contained in:
Albert Krewinkel
2019-01-13 17:14:10 +01:00
parent 9ac5b9d710
commit 42a7b80c04
3 changed files with 43 additions and 10 deletions
+10
View File
@@ -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