mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Parse new lines in text objects correctly
This commit is contained in:
parent
1c7ab5feb4
commit
135fc0b436
@ -282,10 +282,10 @@ function newobject:SetText(t)
|
|||||||
table.insert(self.formattedtext, {font = prevfont, color = prevcolor, linkcolor = prevlinkcolor, linkhovercolor = prevlinkhovercolor, link = link, text = tostring(v)})
|
table.insert(self.formattedtext, {font = prevfont, color = prevcolor, linkcolor = prevlinkcolor, linkhovercolor = prevlinkhovercolor, link = link, text = tostring(v)})
|
||||||
elseif dtype == "string" then
|
elseif dtype == "string" then
|
||||||
if self.ignorenewlines then
|
if self.ignorenewlines then
|
||||||
v = v:gsub(" \n ", " ")
|
v = v:gsub("\n", " ")
|
||||||
v = v:gsub("\n", "")
|
|
||||||
end
|
end
|
||||||
v = v:gsub(string.char(9), " ")
|
v = v:gsub(string.char(9), " ")
|
||||||
|
v = v:gsub("\n", " \n ")
|
||||||
local parts = loveframes.util.SplitString(v, " ")
|
local parts = loveframes.util.SplitString(v, " ")
|
||||||
for i, j in ipairs(parts) do
|
for i, j in ipairs(parts) do
|
||||||
table.insert(self.formattedtext, {font = prevfont, color = prevcolor, linkcolor = prevlinkcolor, linkhovercolor = prevlinkhovercolor, link = link, text = j})
|
table.insert(self.formattedtext, {font = prevfont, color = prevcolor, linkcolor = prevlinkcolor, linkhovercolor = prevlinkhovercolor, link = link, text = j})
|
||||||
@ -778,4 +778,4 @@ function newobject:GetDetectLinks()
|
|||||||
|
|
||||||
return self.detectlinks
|
return self.detectlinks
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user