From 543cb5d45d3ebc4c5a504be42efd6febb3a9ceaa Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 12 Oct 2022 11:29:45 +0200 Subject: Lua: allow Doc values in `WriterOptions.variables`. The specialized peeker and pusher function for `Context Text` values does not go via JSON, and thus keeps Doc values unchanged during round-tripping. --- pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pandoc-lua-engine/src/Text') diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs index a96c3d4b8..48451457b 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/WriterOptions.hs @@ -21,6 +21,7 @@ module Text.Pandoc.Lua.Marshal.WriterOptions import Control.Applicative (optional) import Data.Default (def) import HsLua as Lua +import Text.Pandoc.Lua.Marshal.Context (peekContext, pushContext) import Text.Pandoc.Lua.Marshal.Format (peekExtensions, pushExtensions) import Text.Pandoc.Lua.Marshal.List (pushPandocList) import Text.Pandoc.Lua.Marshal.Template (peekTemplate, pushTemplate) @@ -206,8 +207,8 @@ typeWriterOptions = deftype "WriterOptions" , property "variables" "Variables to set in template" - (pushViaJSON, writerVariables) - (peekViaJSON, \opts x -> opts{ writerVariables = x }) + (pushContext, writerVariables) + (peekContext, \opts x -> opts{ writerVariables = x }) , property "wrap_text" "Option for wrapping text" -- cgit v1.2.3