From acbea6b8c610dba4b63c0f6063c51b26ab9d2b76 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 21 Sep 2020 00:48:31 +0200 Subject: Lua filters: add SimpleTable for backwards compatibility (#6575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new type `SimpleTable` is made available to Lua filters. It is similar to the `Table` type in pandoc versions before 2.10; conversion functions from and to the new Table type are provided. Old filters using tables now require minimal changes and can use, e.g., if PANDOC_VERSION > {2,10,1} then pandoc.Table = pandoc.SimpleTable end and function Table (tbl) tbl = pandoc.utils.to_simple_table(tbl) … return pandoc.utils.from_simple_table(tbl) end to work with the current pandoc version. --- src/Text/Pandoc/Lua/Util.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Lua/Util.hs') diff --git a/src/Text/Pandoc/Lua/Util.hs b/src/Text/Pandoc/Lua/Util.hs index c6639e94c..fbd013801 100644 --- a/src/Text/Pandoc/Lua/Util.hs +++ b/src/Text/Pandoc/Lua/Util.hs @@ -80,7 +80,7 @@ instance (Pushable a, PushViaCall b) => PushViaCall (a -> b) where pushViaCall :: PushViaCall a => String -> a pushViaCall fn = pushViaCall' fn (return ()) 0 --- | Call a pandoc element constructor within lua, passing all given arguments. +-- | Call a pandoc element constructor within Lua, passing all given arguments. pushViaConstructor :: PushViaCall a => String -> a pushViaConstructor pandocFn = pushViaCall ("pandoc." ++ pandocFn) -- cgit v1.2.3