Просмотр исходного кода

Improved recipe config generation for complex objects. Fixes #180

n1474335 8 лет назад
Родитель
Сommit
0192566d19
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      src/core/Utils.js

+ 4 - 4
src/core/Utils.js

@@ -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 + "]";