Rich text character-by-character shows tags. How to hide them?

I have a dialog box that prints this message character-by-character: Hello <b>rat boy</b>.

I’ve create a parser that checks for rich text tags and pastes them into the message (instead of printing them out, one character at a time). The problem is this: For a split second, I can see the tag in the message before it is hidden. This is what my text looks like when this happens: Hello <b>r. And then a split-second later, it looks like this: Hello r.

Does anyone know how to parse a rich text tag before it’s visible in a message?

I created a helpful library for this issue.

You can get substring of rich text just a function.

var richText = "<color=blue>blue</color>black";
richText.RichTextSubString(3); // <color=blue>blu</color>
richText.RichTextSubString(6); // <color=blue>blue</color>bl

You can find it in Github.

Clearly it’s waiting for the closing tag. You would need to write some code to loop through the characters and output it if no < is found, if the current char is < then use reg ex to match what’s inside the opening <> and place a temp closing tag after each character iteration following until you get to next < .

doable but painful few hours of work.