Using ArcGIS JS API 4.23.
I would like to dynamically format the labels of a FeatureLayer based on a set of rules. These rules would result in parts of the label text being italicized.
Rules for parts of the text that should not be italicized (just for example purposes):
- Text between single quotes, brackets, or parentheses
Eg.: Abelia x grandiflora [Hopleys™] = 'Abghop'
I was able to create the logic to format the text correctly in Javascript and apply it to the react components but would like to apply it to the labels as well.
My idea was to use Arcade Expression to recreate the logic I have in Javascript to format the label text based on its results but I wasn't able to italicize partially the text of the FeatureLayer labels.
I did some research and saw that you are able to do that in ArcGIS PRO using XML tags. Is there a way to do that or to achieve the same result using the JS API?