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
@ -283,9 +283,9 @@ function newobject:SetText(t)
|
|||||||
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})
|
||||||
|
Loading…
Reference in New Issue
Block a user