diff options
| author | Albert Krewinkel <[email protected]> | 2025-08-10 12:04:24 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2025-08-12 08:47:49 +0200 |
| commit | 68d80cc9d914c23831aace776f0d5c981fd882e9 (patch) | |
| tree | dd1d65de1e52397352799b7f8ed14befd4ea158e /pandoc-lua-engine/test/lua/module | |
| parent | 511ddc322339f40f30c173568da26c4296722cb5 (diff) | |
Lua: add functions `pandoc.text.superscript` and `subscript`.
The functions convert numbers and parentheses to superscript and
subscript, respectively.
Diffstat (limited to 'pandoc-lua-engine/test/lua/module')
| -rw-r--r-- | pandoc-lua-engine/test/lua/module/pandoc-text.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pandoc-lua-engine/test/lua/module/pandoc-text.lua b/pandoc-lua-engine/test/lua/module/pandoc-text.lua index 71a06c917..c664b755b 100644 --- a/pandoc-lua-engine/test/lua/module/pandoc-text.lua +++ b/pandoc-lua-engine/test/lua/module/pandoc-text.lua @@ -41,6 +41,28 @@ return { test('sub', function () assert.is_function(text.sub) end), + group 'subscript' { + test('is a function', function () + assert.is_function(text.subscript) + end), + test('converts a string to Unicode subscript chars', function () + assert.are_equal(text.subscript '1+(9-7)', '₁₊₍₉₋₇₎') + end), + test('returns nil if the input contains unsupported chars', function () + assert.is_nil(text.subscript '00ä') + end), + }, + group 'superscript' { + test('is a function', function () + assert.is_function(text.superscript) + end), + test('converts a string to Unicode superscript chars', function () + assert.are_equal(text.superscript '1+(9-7)', '¹⁺⁽⁹⁻⁷⁾') + end), + test('returns nil if the input contains unsupported chars', function () + assert.is_nil(text.superscript '00ä') + end), + }, test('toencoding', function () assert.is_function(text.toencoding) end), |
