mirror of
https://github.com/Insality/druid
synced 2025-09-28 10:32:20 +02:00
Update
This commit is contained in:
@@ -108,10 +108,10 @@ end
|
||||
|
||||
|
||||
---Parse the text into individual words
|
||||
-- @param text The text to parse
|
||||
-- @param default_settings Default settings for each word
|
||||
-- @param color_aliases Color aliases table
|
||||
-- @return List of all words
|
||||
---@param text string The text to parse
|
||||
---@param default_settings table<string, any> Default settings for each word
|
||||
---@param style table<string, any> Style settings
|
||||
---@return table<string, any> List of all words
|
||||
function M.parse(text, default_settings, style)
|
||||
assert(text)
|
||||
assert(default_settings)
|
||||
@@ -185,6 +185,8 @@ end
|
||||
|
||||
|
||||
---Get the length of a text, excluding any tags (except image and spine tags)
|
||||
---@param text string The text to get the length of
|
||||
---@return number The length of the text
|
||||
function M.length(text)
|
||||
return utf8.len(text:gsub("<img.-/>", " "):gsub("<.->", ""))
|
||||
end
|
||||
|
Reference in New Issue
Block a user