I never got into BB script tags, nor have I hand-coded FontAwesome, so the practice of using an empty tag pair has always seemed strange to me. Is that by popular convention, or is there a webcraft reason for using tag pairs? Also, can they have stuff between them, does that affect the text?
First when I wrote the wrap BBCode feature, @sam explicitly asked to me support 3 formats:
This is done to be consistent with our existing BBCode usage in Discourse.
I could have a better syntax as: [icon=times] but then it would have to be a plugin and not a theme component.
As an experimentation, I think it’s fine as it is today, and if people were to use it a lot, we could think of having a plugin do this with a more concise syntax.
Another idea I have had is to add an API to add autocompletes symbol in the composer just like we have fore users/categories/emojis… But I’m afraid this would be a nightmare with multiple components choosing their own symbol…
Oh! I need to add support for another bbcode and those) thought that I’d use this as a starting point, but you’re saying that the wrap stuff is handled in core, which explains why I can’t find how it’s handled by your theme component.
My current solution is to use the linked words component and an ugly regex, but I’m still struggling to add the necessary classes to the links.
I see the issue. The component searches by looking at whether there is a wrapper with d-wrap class; but there is no wrapper if the provided icon is not from the subset. It creates an image as SVG instead.
Does this mean I need to have an svg_icons field in settings.yml available in my theme? Or could I use any svg_icons field available from any enabled theme-components too? And if that is the case would adding this field to this theme-component make sense?