Fixed BBCode Font Awesome icons not showing while previewing post/thread

Affected version
2.3.3
Apologies if I posted in the wrong forums.

I'm currently working on an update to 2.3. We haven't updated in a while and figured it might be a good time.
With the changes in 2.3 regarding FA icons, I needed to find a way to implement back FA Icons in posts through Custom BBCodes (which is something that should really become native if you ask me, as it's quite useful). I was able to, with help from these two threads:

The BBCode in particular:
Code:
<i class="fas fa-{text}" data-xf-init="icon"></i>

However, the icons won't show up while previewing the post:

Editor:
1727958993486.webp

Preview:
1727959053193.webp

As you can see, the space for the icon is there. If I check the inspector, it's also there but with an empty SVG tag:
1727959104633.webp

If I post it, however. It works correctly.
1727959233562.webp

Considering the SVG tag is empty in the preview, I figured it might have something to do with SVGs specifically, but I tried another BBCode with an <svg> tag and it worked flawlessly, so that wasn't it.


Please note, this worked perfectly on our old forums, which was in v2.1.15:
1727960451021.webp
The old BBCode (which no longer works in 2.3):
Code:
<i class="fas fa-{text}"></i>
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.4).

Change log:
Fix some issues with the JS icon renderer and BBCode previews
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom