Skip to content

Commit bca6583

Browse files
committed
lua-types - Add Pandoc 3.8 API additions (normalize, subscript, superscript)
1 parent bdcec01 commit bca6583

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

src/resources/lua-types/pandoc/pandoc.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ Make a clone
3434
---@return pandoc.Pandoc
3535
function pandoc.Pandoc:clone() end
3636

37+
--[[
38+
Perform a normalization of Pandoc documents. E.g., multiple
39+
successive spaces are collapsed, and tables are normalized, so
40+
that all rows and columns contain the same number of cells.
41+
]]
42+
---@return pandoc.Pandoc # Cloned and normalized document
43+
function pandoc.Pandoc:normalize() end
3744

3845
--[[
3946
Applies a Lua filter to the Pandoc element. Just as for

src/resources/lua-types/pandoc/text.lua

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,30 @@ other platforms it will try to guess the file system's encoding.
7777
The set of known encodings is system dependent, but includes at
7878
least `UTF-8`, `UTF-16BE`, `UTF-16LE`, `UTF-32BE`, and `UTF-32LE`.
7979
Note that the default code page on Windows is available through
80-
`CP0`.
80+
`CP0`.
8181
]]
8282
---@param s string string to convert
8383
---@param encoding string Encoding of the input string
8484
---@return string
8585
function pandoc.text.toencoding(s, encoding) end
8686

87+
--[[
88+
Tries to convert the string into a Unicode subscript version.
89+
Returns nil if not all characters can be mapped to subscript.
90+
Supported characters include numbers, parentheses, and plus/minus.
91+
]]
92+
---@param input string String to convert to subscript
93+
---@return string|nil # Subscript version or nil if conversion not possible
94+
function pandoc.text.subscript(input) end
95+
96+
--[[
97+
Tries to convert the string into a Unicode superscript version.
98+
Returns nil if not all characters can be mapped to superscript.
99+
Supported characters include numbers, parentheses, and plus/minus.
100+
]]
101+
---@param input string String to convert to superscript
102+
---@return string|nil # Superscript version or nil if conversion not possible
103+
function pandoc.text.superscript(input) end
87104

88105

89106
return pandoc.text

0 commit comments

Comments
 (0)