From 4e459de01c56032f36735e63c76d42909fc926b2 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 12 Sep 2024 10:56:54 +0800 Subject: [PATCH] fixed --- History.md | 4 ++++ package.json | 2 +- src/lib/string.js | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index 8e02388..48c3d68 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,7 @@ +2.4.2 / 2024-09-12 +================== + * 优化字符串转义 + 2.4.0 / 2024-08-22 ================== * 增加Set的一系列原型方法`union、equal、difference、symmetricDifference、intersection、isSubsetOf、isSupersetOf、isDisjointFrom` diff --git a/package.json b/package.json index 034e20e..6ca5fa1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es.shim", - "version": "2.4.1", + "version": "2.4.2", "description": "实现部分新API, 以及一些常用的扩展方法", "keyworks": [ "es5", diff --git a/src/lib/string.js b/src/lib/string.js index 025d0d0..c49cbb3 100644 --- a/src/lib/string.js +++ b/src/lib/string.js @@ -93,6 +93,7 @@ if (!String.prototype.tohtml) { return this.replace(/</gi, '<') .replace(/>/gi, '>') .replace(/"/gi, '"') + .replace(/"/g, '"') .replace(/'/g, "'") .replace(/&/gi, '&') }