This commit is contained in:
Robert Jelic
2023-06-15 18:22:45 +02:00

View File

@@ -167,7 +167,9 @@ local function wrapRichText(text, width)
elseif entry.bgColor then
currentBgColor = entry.bgColor
else
local words = splitString(entry.text, " ")
local paragraphs = splitString(entry.text, "\n")
for p, paragraph in ipairs(paragraphs) do
local words = splitString(paragraph, " ")
for i, word in ipairs(words) do
local wordLength = #word
@@ -197,6 +199,12 @@ local function wrapRichText(text, width)
end
end
end
if p ~= #paragraphs then
x = 1
y = y + 1
end
end
end
if x > width then
@@ -211,6 +219,7 @@ end
return {
getTextHorizontalAlign = function(text, width, textAlign, replaceChar)
text = sub(text, 1, width)