Parse new lines in text objects correctly

This commit is contained in:
Ethan Shaughnessy 2014-02-22 14:48:49 -07:00
parent 1c7ab5feb4
commit 135fc0b436

View File

@ -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})