diff options
| author | Albert Krewinkel <[email protected]> | 2024-12-10 11:36:00 +0100 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2024-12-10 11:45:51 +0100 |
| commit | a0847310700d8c706203471c871a6805c221092c (patch) | |
| tree | 1090779b7c60469d7ea6343280c1d61ca9b41364 /pandoc-lua-engine/test/lua/module | |
| parent | 64f45fefa7a8cb5597d1eb63ca3f276a56802ccf (diff) | |
Lua: support more elements as input to `pandoc.utils.stringify`.
Elements of type Caption, Cell, TableHead, and TableFoot can now be
stringified.
Fixes: #10450
Diffstat (limited to 'pandoc-lua-engine/test/lua/module')
| -rw-r--r-- | pandoc-lua-engine/test/lua/module/pandoc-utils.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pandoc-lua-engine/test/lua/module/pandoc-utils.lua b/pandoc-lua-engine/test/lua/module/pandoc-utils.lua index 573a5987a..9694cd57b 100644 --- a/pandoc-lua-engine/test/lua/module/pandoc-utils.lua +++ b/pandoc-lua-engine/test/lua/module/pandoc-utils.lua @@ -223,6 +223,22 @@ return { local inlines = pandoc.Inlines{pandoc.Str 'a', pandoc.Subscript('b')} assert.are_equal('ab', utils.stringify(inlines)) end), + test('Caption', function () + local capt = pandoc.Caption(pandoc.Para{pandoc.Str 'a', pandoc.Emph('b')}) + assert.are_equal('ab', utils.stringify(capt)) + end), + test('Cell', function () + local cell = pandoc.Cell(pandoc.Para{pandoc.Str 'a', pandoc.Emph('b')}) + assert.are_equal('ab', utils.stringify(cell)) + end), + test('TableFoot', function () + local tf = pandoc.TableFoot{pandoc.Row{pandoc.Cell{pandoc.Plain "x y"}}} + assert.are_equal('x y', utils.stringify(tf)) + end), + test('TableHead', function () + local th = pandoc.TableHead{pandoc.Row{pandoc.Cell{pandoc.Plain "head1"}}} + assert.are_equal('head1', utils.stringify(th)) + end), test('Meta', function () local meta = pandoc.Meta{ a = pandoc.Inlines 'funny and ', |
