geojs 1.12.2 → 1.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commitlint.config.js +6 -0
- package/geo.js +14 -3
- package/geo.lean.js +14 -3
- package/geo.lean.min.js +1 -1
- package/geo.min.js +1 -1
- package/package.json +1 -1
- package/src/util/common.js +12 -1
package/package.json
CHANGED
package/src/util/common.js
CHANGED
|
@@ -971,11 +971,22 @@ var util = {
|
|
|
971
971
|
* @memberof geo.util
|
|
972
972
|
*/
|
|
973
973
|
escapeUnicodeHTML: function (text) {
|
|
974
|
-
return text.replace(
|
|
974
|
+
return text.replace(/[^- 0-9A-Za-z~`!@#$%^&*()_+={}|[\]\\:";'<>?,./]/g, function (k, pos) {
|
|
975
975
|
var code = k.charCodeAt(0);
|
|
976
976
|
if (code < 127) {
|
|
977
977
|
return k;
|
|
978
978
|
}
|
|
979
|
+
/* decode utf016 surrogate pairs */
|
|
980
|
+
if (code >= 0xD800 && code <= 0xE000) {
|
|
981
|
+
if (code < 0xDC00 || pos) {
|
|
982
|
+
return '';
|
|
983
|
+
}
|
|
984
|
+
var code0 = text.charCodeAt(pos - 1);
|
|
985
|
+
if (code0 < 0xD800 || code0 >= 0xDC00) {
|
|
986
|
+
return '';
|
|
987
|
+
}
|
|
988
|
+
code = (code0 - 0xD800) * 0x400 + (code - 0xDC00);
|
|
989
|
+
}
|
|
979
990
|
return '&#' + code.toString(10) + ';';
|
|
980
991
|
});
|
|
981
992
|
},
|