mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 06:01:02 +01:00
Improved recipe config generation for complex objects. Fixes #180
This commit is contained in:
parent
8a8b70f2ab
commit
0192566d19
@ -924,8 +924,8 @@ const Utils = {
|
||||
// need to be percent-encoded.
|
||||
.replace(/'/g, "\\'") // Escape single quotes
|
||||
.replace(/\\"/g, '"') // Unescape double quotes
|
||||
.replace(/(^|,)"/g, "$1'") // Replace opening " with '
|
||||
.replace(/"(,|$)/g, "'$1"); // Replace closing " with '
|
||||
.replace(/(^|,|{|:)"/g, "$1'") // Replace opening " with '
|
||||
.replace(/"(,|:|}|$)/g, "'$1"); // Replace closing " with '
|
||||
|
||||
disabled = op.disabled ? "/disabled": "";
|
||||
bp = op.breakpoint ? "/breakpoint" : "";
|
||||
@ -959,8 +959,8 @@ const Utils = {
|
||||
// Translate strings in args back to double-quotes
|
||||
args = m[2]
|
||||
.replace(/"/g, '\\"') // Escape double quotes
|
||||
.replace(/(^|,)'/g, '$1"') // Replace opening ' with "
|
||||
.replace(/([^\\])'(,|$)/g, '$1"$2') // Replace closing ' with "
|
||||
.replace(/(^|,|{|:)'/g, '$1"') // Replace opening ' with "
|
||||
.replace(/([^\\])'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
||||
.replace(/\\'/g, "'"); // Unescape single quotes
|
||||
args = "[" + args + "]";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user