瀏覽代碼

Merge pull request #87 from AykutSarac/fix-escape-characters

Fix escape character rendering
Aykut Saraç 2 年之前
父節點
當前提交
65ca525451
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/containers/Editor/LiveEditor/helpers.ts

+ 4 - 1
src/containers/Editor/LiveEditor/helpers.ts

@@ -6,7 +6,10 @@ const toString = (value: string | object) => {
 
   if (isObject) {
     const entries = Object.entries(value);
-    const stringObj = entries.map((val) => [val[0], String(val[1])]);
+    const stringObj = entries.map((val) => [
+      JSON.stringify(val[0]).replaceAll('"', ""),
+      JSON.stringify(val[1]),
+    ]);
 
     return Object.fromEntries(stringObj);
   }