There is a bug in Text Mesh Pro where if you paste text containing whitespace into a text mesh pro component, and delete it with the backspace key, you can cause text that uses a link style tag to be drawn on top of other text.
Example from my bug report:
After you’ve deleted the space in the inspector, it looks like there is no more whitespace, but if you hit backspace 1 more time, the problem goes away. This bug doesn’t occur if you get rid of the whitespace with the delete key.
This might not seem like a big bug, but it caused me pain for over a year, my app has a lot of links and text coming in from google sheets, and I had no clue what was causing the issue.
Most likely your original text contains both CR, LF where you ended up deleting the Line Feed and kept the Carriage returns in there. Since the function of Carriage Return is to return the carriage to the start of the line, it would result in the text being displayed over the previous text.
Using some ASCII viewer, as you can see below, the raw text contains or char(13) and or char(10). As you delete the LF leaving the CR behind, the text will overlap.
This behavior is by design as this is exactly the function of Carriage Return which is to reset the pen position / carriage back to the start of the line but without adding a new line.
If you are grabbing text from different places, you might want to replace those CR / LF by just a LF.
Thanks for the explanation, I know little about text formatting. Do you think it’s possible to automatically replace the CR when I load the text in Unity? For this project I don’t actually know the people creating the text content, would just save me a job of manually checking it looks ok.