Partial fix XF.alert doesn't handle HTML tags

stromb0li

Well-known member
Affected version
2.3
When using XF.alert to display an alert to the client, the text after the first html tag will be discarded.

In XF 2.2, I'd see moo cow (on two lines). In XF 2.3, I only see moo.

JavaScript:
const stringArray = ['moo', 'cow'];
XF.alert(stringArray.join('<br/>'));

This seems to work as a workaround:
JavaScript:
const stringArray = ['moo', 'cow'];
XF.alert(stringArray.join('\r\n'));
 
Last edited:
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.3).

Change log:
Allow passing HTMLElement objects to alerts
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom