@Jay Reopening this as I found another bug in the tag formatting
Given 2 levels of prefixes in the tags,
When you have 2 tags that start with the same prefix (there might be 2 levels of tag prefixes embedded) Legend is assuming that only the first match will apply.
It seems that you are parsing the display settings for the tags and stopping when you find the first match.
This example shows incorrect formatting when I set the #cat first and the #catproblems afterwards.
However if I invert the order and set the #catproblems first and the #cat afterwards, the tags are formatted correctly.
I am lowering the priority as there is a workaround so no rush, but it might be confusing for new users.