Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strings not translated properly #46

Open
gecko10000 opened this issue Aug 15, 2021 · 1 comment
Open

Strings not translated properly #46

gecko10000 opened this issue Aug 15, 2021 · 1 comment

Comments

@gecko10000
Copy link

gecko10000 commented Aug 15, 2021

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.

@BlitzOffline
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants