Skip to content

Strings not translated properly #46

Open

Description

@gecko10000

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.

Activity

  1. BlitzOffline commented on Aug 16, 2021

    @BlitzOffline
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions