I have a system in my game where people can send messages to other servers. I use richtext markup to color the usernames of people, but when people use things such as “<” the richtext freaks out as seen here, where someone wanted to post <3.
Creating two text labels like @bluechristmas20181 mentioned is quite straightforward. I don’t know about zero width non-joiners, but if you opt to keep one text label, you can also iterate it and replace these few characters in question with their escape forms:
local escapeForms = {
["<"] = "<";
[">"] = ">";
['"'] = """;
["'"] = "'";
["&"] = "&";
}
local message = "Hi <3"
message = string.gsub(message, ".", function(c)
return escapeForms[c] or c
end)
print(message)