htmlspecialchars would break the link again, which is the original issue: https://wikia-inc.atlassian.net/browse/VOLDEV-10 (raw HTML links in i18n messages should generally be avoided).

Since this is a concern, it's possibly better to get the modal from a controller method that sets the messages (or just to get the content of the messages) than using this way of getting the message content by including the message in a JS variable on the page like it is now...