Text Display Object anomaly using rich text

Spent a bunch of time today trying to figure out why my Text Display Object was acting strange when using rich text. If I entered a color and then tried in the formula to go back to the original color or change the color nothing would happen and everything after the first <color:xxxxxx> tag would remain that color. Same thing for other tags like <b> and <i> and others. Once first issued it ignored any other following tag that tried to change or negate it.

Well, after a lot of head scratching I was finally able to track the behavior down to the Line Breaks option for the TDO. If that setting is anything other than Word Wrap it will display the above noted anomaly. Change it back to Word Wrap and rich text acts as expected. Here is a screen shot that shows this by comparing two TDO set to different Line Breaks but using the same rich text formula.

image

Thanks for this excellent bug report. I was able to duplicate the exact symptoms.

Unfortunately, it appears that this is an Apple issue that I can’t do anything about. If you are interested in the details I wrote them up in this Bitbucket post.

Rich Text is also unable to display a < as part of the content and truncates everything that follows. I can’t find a way to escape it.

Screen Shot 2022-04-28 at 12.15.39 PM

Screen Shot 2022-04-28 at 12.15.46 PM

The “<” character must be enclosed with the richtextdata( function to avoid this problem. You can either enclose the entire text with the richtextdata( function or just the “<” character.

1 Like

Note that you can not have any of the rich text tags within the richtextdata( function or they will be ignored.

Thanks Gary. I obviously did a good job of missing that as I looked for all sorts of escape mechanisms instead.

Rich text also lets you change its tags from <, > to something else, including multi character tags. Check the bottom of its help. So that could be another workaround.

I think it would be more accurate to say that they will be included “as-is”, rather than be interpreted as style tags. I’m sure that’s what you meant, but I wanted to make sure that was clear. This is exactly what the point of this function is, to include text without worrying about whether or not it contains style tags.