Getting a weird issue where not all the characters are orange
<color="orange">Total forces</color>

Turns out its caused from this.
It thinks there is a link in this text. Not sure why.
void ON_TEXT_CHANGED(Object obj){
if (!IgnoreLinkColors && obj == m_TextMeshPro){
TMP_LinkInfo[] AllLinks = m_TextMeshPro.textInfo.linkInfo;
foreach (TMP_LinkInfo Link in AllLinks) {
linkInfo = Link;
ChangeLinkColor(defaultColor);
}
}
}
Im getting a error spamming in my console when I add line
<style="small_list">3% intelligence strength</style>
Can’t for the life of me figure out why.
<style="small_list">3% increase to naqahdah production</style>
<style="small_list">3% military offense/defense</style>
<style="small_list">3% infiltrate strength</style>
<style="small_list">3% intelligence strength</style>
<style="small_list">1% planet efficiency</style>
<style="small_list">5% daily bonus</style>
IndexOutOfRangeException: Index was outside the bounds of the array.
TMPro.TMP_Text.ReplaceClosingStyleTag (System.String& sourceText, System.Int32 srcIndex, TMPro.TMP_Text+UnicodeChar[ ]& charBuffer, System.Int32& writeIndex) (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMP_Text.cs:3812)
TMPro.TMP_Text.StringToInternalParsingBuffer (System.String sourceText, TMPro.TMP_Text+UnicodeChar[ ]& internalParsingArray) (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMP_Text.cs:3040)
TMPro.TMP_Text.ParseInputText () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMP_Text.cs:1887)
TMPro.TMP_Text.GetPreferredWidth () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMP_Text.cs:4982)
TMPro.TextMeshProUGUI.CalculateLayoutInputHorizontal () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TextMeshProUGUI.cs:89)
UnityEngine.UI.LayoutRebuilder.m__2 (UnityEngine.Component e) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:84)
UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction1[T0] action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:147)** **UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction
1[T0] action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:144)
UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction1[T0] action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:144)** **UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction
1[T0] action) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:144)
UnityEngine.UI.LayoutRebuilder.Rebuild (UnityEngine.UI.CanvasUpdate executing) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Layout/LayoutRebuilder.cs:84)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:171)
UnityEngine.UI.ScrollRect:LateUpdate() (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/ScrollRect.cs:797)
NullReferenceException: Object reference not set to an instance of an object
TMPro.TextMeshProUGUI.UpdateSDFScale (System.Single scaleDelta) (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMPro_UGUI_Private.cs:4646)
TMPro.TextMeshProUGUI.InternalUpdate () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMPro_UGUI_Private.cs:1670)
TMPro.TMP_UpdateManager.DoRebuilds () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMP_UpdateManager.cs:121)
UnityEngine.Canvas.SendWillRenderCanvases () (at C:/buildslave/unity/build/Runtime/UI/ScriptBindings/UICanvas.bindings.cs:72)
UnityEngine.Canvas.ForceUpdateCanvases () (at C:/buildslave/unity/build/Runtime/UI/ScriptBindings/UICanvas.bindings.cs:66)
UnityEngine.UI.ScrollRect.EnsureLayoutHasRebuilt () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/ScrollRect.cs:608)
UnityEngine.UI.ScrollRect.LateUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/ScrollRect.cs:797
Turns out the style tag error is simply from not having those style tags defined. Idk why it only started doing it at that line though lol.
I figured i could add all my styles first and then define them later. Apparently no.
How are those not defined? Do you mean they are created but with no Opening or Closing style definitions?
I didn’t add those tags to my style sheet yet. Also didn’t even have a style sheet assigned yet to TextMeshProUGUI
And after 4 or so style tags it errors apparently.
First added 3 styles to my game guide and I hit play to test it and worked fine no error. So I said to my self well I’ll just add all my styles in first and then go define them in a style sheet.
After like 4 or 5 tags it starts to error.
I would like to take a closer look. If you can provide me with a simple repro project that would be great.
ehh its not to important. just make sure you add the style tag before adding the tag.
The color issue though is my problem now

This returns a length of 1. It detects this as a link. Should textInfo.linkinfo only return links?
<color="orange">Total forces</color>
TMP_LinkInfo[] AllLinks = m_TextMeshPro.textInfo.linkInfo;
foreach (TMP_LinkInfo Link in AllLinks) {
if (gameObject.name == "Army Name") {
Debug.Log(AllLinks.Length);
}
}
}
This is effecting my entire project I just noticed. Text that don’t have any links in it at all.
Can you not duplicate this?
Alright narrowing down on the problem
TMP_LinkInfo[] AllLinks = m_TextMeshPro.textInfo.linkInfo;
bool FirstLinkCheck = true;
foreach (TMP_LinkInfo Link in AllLinks) {
Debug.Log(Link.GetLinkText());
}
This returns Total forc
instead of Total forces
course it shouldn’t be returning anything since its not even a link. But even with it returning something it doesn’t return everything in the text input.
Another interesting thing i just came accross while debugging.
<link="profile_name#Shadowings">Shadowings</link> has attacked Planet <link="location#136">SHELIAK 82</link> Click to see the <link="battle_report#94">Battle Report</link>
I get hit with this error when I try to do Debug.Log(Link.GetLinkText());
void ON_TEXT_CHANGED(Object obj){
if (!IgnoreLinkColors && obj == m_TextMeshPro){
TMP_LinkInfo[] AllLinks = m_TextMeshPro.textInfo.linkInfo;
bool FirstLinkCheck = true;
foreach (TMP_LinkInfo Link in AllLinks) {
Debug.Log(Link.GetLinkText());
linkInfo = Link;
ChangeLinkColor(OverrideFirstLinkColor && FirstLinkCheck ? DefaultColor : defaultColor);
FirstLinkCheck = false;
}
}
}
NullReferenceException: Object reference not set to an instance of an object
TMPro.TMP_LinkInfo.GetLinkText () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMPro_MeshUtilities.cs:148)
GameLink.ON_TEXT_CHANGED (UnityEngine.Object obj) (at Assets/GameLink.cs:78)
TMPro.FastAction`1[A].Call (A a) (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/FastAction.cs:73)
TMPro.TMPro_EventManager.ON_TEXT_CHANGED (UnityEngine.Object obj) (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMPro_EventManager.cs:93)
TMPro.TextMeshProUGUI.GenerateTextMesh () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMPro_UGUI_Private.cs:4492)
TMPro.TextMeshProUGUI.OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TMPro_UGUI_Private.cs:1768)
TMPro.TextMeshProUGUI.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Library/PackageCache/com.unity.textmeshpro@1.5.0-preview.8/Scripts/Runtime/TextMeshProUGUI.cs:247)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:198)
UnityEngine.Canvas:SendWillRenderCanvases() (at C:/buildslave/unity/build/Runtime/UI/ScriptBindings/UICanvas.bindings.cs:72)
It does the other Texts just fine until It hits this one. If I remove that debug.Log everything works fine. It parses the links correctly and everything. not a single issue.

Can you please submit a bug report with the included project and steps for me to reproduce the behavior?
If you are able to do so and can provide me with the Case # once you have it from Unity via email, I’ll make sure to take a look tomorrow and hopefully provide you with a solution shortly thereafter.
The link tag format is as follows:
<link=“ID”>Some text for display
The ID is a unique identifier to allow the identification of the link. This is not a description and it is best to keep it to less than 16 characters.
This link ID can actually be up to 128 characters like any other tag value but given its purpose is to allow the identification of a link, it would be very wasteful to use more than the number of characters needed to make sure each ID is unique.
Most of the time, these ID are sequential and a Key in some lookup data structure like a Dictionary that contains the real description and whatever other meta data needed to implement whatever functionality you need.
That doesn’t work for dynamic data though. I tried to explain this in another thread a year ago.
Thats why links needs a data field.
<link="ID" data="data string">Some text for display</link>
<link="external_link" data="https://google.com">Google</link>
You can’t use a dictionary for dynamic data. Thats static data.
I can’t create a dictionary of every website in existance lol.
I let players do links in chat
External links is not the only thing I use links for. Here is another example.
<link="player_profile" data="user_id">Player Name</link>
or
<link="location" data="location_id">Planet Name</link>
The way I handle this with TextMeshPRo since there is no data link 
is by doing something like this.
<link="ClassID#Data1#Data2#Data3">Some text for display</link>
or
<link="location#location_id">Planet Name</link>
Then I just separate each # into an array and execute my function.