Browse Source

JSON格式化针对try-catch模式做兼容

zxlie 7 years ago
parent
commit
958b56714d
3 changed files with 5 additions and 5 deletions
  1. 1 1
      apps/json-format/automatic.js
  2. 1 1
      apps/manifest.json
  3. 3 3
      apps/qr-code/decode.js

+ 1 - 1
apps/json-format/automatic.js

@@ -168,7 +168,7 @@ module.exports = (() => {
             // 再看看是不是jsonp的格式
             let reg = /^([\w\.]+)\(\s*([\s\S]*)\s*\)$/gm;
             let reTry = /^(try\s*\{\s*)?/g;
-            let reCatch = /(\}\s*catch\s*\(\s*\S+\s*\)\s*\{([\s\S])*\})?$/g;
+            let reCatch = /([;\s]*\}\s*catch\s*\(\s*\S+\s*\)\s*\{([\s\S])*\})?[;\s]*$/g;
 
             // 检测是否有try-catch包裹
             let sourceReplaced = source.replace(reTry, function () {

+ 1 - 1
apps/manifest.json

@@ -1,6 +1,6 @@
 {
   "name": "WEB前端助手(FeHelper)",
-  "version": "2018.11.1911",
+  "version": "2018.11.1921",
   "manifest_version": 2,
   "default_locale": "zh_CN",
   "description": "FE助手:包括JSON格式化、二维码生成与解码、信息编解码、代码压缩、美化、页面取色、Markdown与HTML互转、网页滚动截屏、正则表达式、时间转换工具、编码规范检测、页面性能检测、Ajax接口调试、密码生成器、JSON比对工具、网页编码设置、便签笔记",

+ 3 - 3
apps/qr-code/decode.js

@@ -15,9 +15,9 @@ module.exports = (() => {
                 '<textarea style="display:block;border-radius:5px 5px;width:398px;border:1px solid #aaa;min-height:80px;resize:none;box-shadow:2px 2px 5px #aaa;padding:10px;font-size:14px;color:#888;"></textarea>' +
                 '<div style="margin-top:10px;">' +
                 '<span id="__fehelper_qr_msg_" style="float: right;color:#f00;display:none;">复制成功!</span>' +
-                '<a id="__fehelper_qr_open_" style="margin-right:20px;color: #00f;text-decoration: underline;display: inline;" href="#">打开</a>' +
-                '<a id="__fehelper_qr_copy_" style="margin-right:20px;color: #00f;text-decoration: underline;display: inline;" href="#">复制</a>' +
-                '<a id="__fehelper_qr_close_" style="margin-top:10px;color: #00f;text-decoration: underline;display: inline" href="#">关闭</a>' +
+                '<a id="__fehelper_qr_open_" style="margin-right:20px;color: #00f;text-decoration: underline;display: inline;font-size:12px" href="#">打开</a>' +
+                '<a id="__fehelper_qr_copy_" style="margin-right:20px;color: #00f;text-decoration: underline;display: inline;font-size:12px" href="#">复制</a>' +
+                '<a id="__fehelper_qr_close_" style="margin-top:10px;color: #00f;text-decoration: underline;display: inline;font-size:12px" href="#">关闭</a>' +
                 '</div></div>' +
                 '</div>').appendTo('body');