I'm trying to make a Character template that can auto-fill categories, but I also want those categories has icons next to their text in the infobox (and only in the infobox!).

As you can see, I managed to get the icons appear in the infobox, but it makes the auto-categories broken.

Is there a way to make both functions work?

Community content is available under CC-BY-SA unless otherwise noted.