mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Improved recipe config generation for complex objects. Fixes #180
This commit is contained in:
parent
8a8b70f2ab
commit
0192566d19
1 changed files with 4 additions and 4 deletions
|
@ -924,8 +924,8 @@ const Utils = {
|
||||||
// need to be percent-encoded.
|
// need to be percent-encoded.
|
||||||
.replace(/'/g, "\\'") // Escape single quotes
|
.replace(/'/g, "\\'") // Escape single quotes
|
||||||
.replace(/\\"/g, '"') // Unescape double quotes
|
.replace(/\\"/g, '"') // Unescape double quotes
|
||||||
.replace(/(^|,)"/g, "$1'") // Replace opening " with '
|
.replace(/(^|,|{|:)"/g, "$1'") // Replace opening " with '
|
||||||
.replace(/"(,|$)/g, "'$1"); // Replace closing " with '
|
.replace(/"(,|:|}|$)/g, "'$1"); // Replace closing " with '
|
||||||
|
|
||||||
disabled = op.disabled ? "/disabled": "";
|
disabled = op.disabled ? "/disabled": "";
|
||||||
bp = op.breakpoint ? "/breakpoint" : "";
|
bp = op.breakpoint ? "/breakpoint" : "";
|
||||||
|
@ -959,8 +959,8 @@ const Utils = {
|
||||||
// Translate strings in args back to double-quotes
|
// Translate strings in args back to double-quotes
|
||||||
args = m[2]
|
args = m[2]
|
||||||
.replace(/"/g, '\\"') // Escape double quotes
|
.replace(/"/g, '\\"') // Escape double quotes
|
||||||
.replace(/(^|,)'/g, '$1"') // Replace opening ' with "
|
.replace(/(^|,|{|:)'/g, '$1"') // Replace opening ' with "
|
||||||
.replace(/([^\\])'(,|$)/g, '$1"$2') // Replace closing ' with "
|
.replace(/([^\\])'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
||||||
.replace(/\\'/g, "'"); // Unescape single quotes
|
.replace(/\\'/g, "'"); // Unescape single quotes
|
||||||
args = "[" + args + "]";
|
args = "[" + args + "]";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue