Getting rawtext from richtext

So say I had a rich text string that went

Text = '<font color = "#000000"> Hi </font>'

This works fine, but when you try to reference the text by printing it, it doesnt spit out “Hi”, it spits out Hi along with the tags. Is there a way to get the actual text or do you have to use string.sub and get it yourself?

The text including the tags is the raw text. But to get what is being rendered,

Text:match("<.*>(.*)<.*>")

will get what you want.

2 Likes