diff options
| author | Albert Krewinkel <[email protected]> | 2022-10-27 22:04:59 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2022-10-27 22:09:39 +0200 |
| commit | 6c4d885bdaf8f31afafa5a785a3517a40b529408 (patch) | |
| tree | 269792ebd45c72ec758a497c5e3039ed8c5391c7 /pandoc-lua-engine/test/lua | |
| parent | 91436ebbf45d8d0891053ebdfbb837c71c4bf33a (diff) | |
Lua: allow strings in place of compiled templates.
This allows to use a string as parameter to `pandoc.template.apply` and
in the WriterOptions `template` field.
Closes: #8321
Diffstat (limited to 'pandoc-lua-engine/test/lua')
| -rw-r--r-- | pandoc-lua-engine/test/lua/module/pandoc-template.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pandoc-lua-engine/test/lua/module/pandoc-template.lua b/pandoc-lua-engine/test/lua/module/pandoc-template.lua index bda24da65..94685be3d 100644 --- a/pandoc-lua-engine/test/lua/module/pandoc-template.lua +++ b/pandoc-lua-engine/test/lua/module/pandoc-template.lua @@ -81,5 +81,12 @@ return { 'song: Along Comes Mary' ) end), + test('accepts string as template', function () + local context = {number = '2'} + assert.are_equal( + template.apply('$Song $number$', context):render(), + 'Song 2' + ) + end) }, } |
