Skip to content

Escape doesn't escape anything at all when using double quotes #5

Description

@kornelski

return str.replace(/"/g, '"');

return str.replace(/"/g, '"');

The replacement string was probably meant to be '\\"'.

The code should be

return str.replace(/\\/g, '\\\\').replace(/"/g, '\\"');

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions