You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When placeholders are replaced while parsing a placeholder, they are not translated into string form properly. If the placeholder contains " at all, the script will break. For example, in this case the user can set whatever AFK message they want:
but if they set it to " the script errors and points to an unclosed quote on the first line.
A solution to this would be to either translate the string to replace special characters like quotes and backslashes before putting it into the script, or having an option for this in javascript_placeholders.yml.
The text was updated successfully, but these errors were encountered:
Just to explain his issue better, strings are translated properly.
The problem is that placeholders are parsed before and if they contain double quotes they basically don't get escaped. They want an option that would basically escape characters after parsing the placeholders and then set them in variables.
When placeholders are replaced while parsing a placeholder, they are not translated into string form properly. If the placeholder contains
"
at all, the script will break. For example, in this case the user can set whatever AFK message they want:afk = "%cmi_user_afk_msg%";
function formatAFK() {
return afk == "" ? "" : ": " + afk;
}
formatAFK();
but if they set it to
"
the script errors and points to an unclosed quote on the first line.A solution to this would be to either translate the string to replace special characters like quotes and backslashes before putting it into the script, or having an option for this in
javascript_placeholders.yml
.The text was updated successfully, but these errors were encountered: