Skip to content

Commit 582edc2

Browse files
committed
fix
1 parent 2a92521 commit 582edc2

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Switch Traditional Chinese and Simplified Chinese/Switch Traditional Chinese and Simplified Chinese.user.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:ja 简繁
55
// @name:en Switch Traditional Chinese and Simplified Chinese
66
// @namespace hoothin
7-
// @version 1.1
7+
// @version 1.1.1
88
// @description 任意轉換網頁中的簡體中文與繁體中文(默認簡體→繁體)
99
// @description:zh-CN 任意转换网页中的简体中文与繁体中文(默认繁体→简体)
1010
// @description:ja 简繁中国語に変換
@@ -77,8 +77,10 @@
7777
var str='', index, char;
7878
for(var i=0;i<orgStr.length;i++){
7979
char=orgStr.charAt(i);
80-
index=scStr.indexOf(char);
81-
if(char.charCodeAt(0) > 10000 && index != -1) str+=tcStr.charAt(index);
80+
if(char.charCodeAt(0) > 10000){
81+
index=scStr.indexOf(char);
82+
if(index != -1)str+=tcStr.charAt(index);
83+
}
8284
else str+=char;
8385
}
8486
return str;
@@ -88,8 +90,10 @@
8890
var str='', index, char;
8991
for(var i=0;i<orgStr.length;i++){
9092
char=orgStr.charAt(i);
91-
index=tcStr.indexOf(char);
92-
if(char.charCodeAt(0) > 10000 && index != -1) str+=scStr.charAt(index);
93+
if(char.charCodeAt(0) > 10000){
94+
index=tcStr.indexOf(char);
95+
if(index != -1)str+=scStr.charAt(index);
96+
}
9397
else str+=char;
9498
}
9599
return str;

0 commit comments

Comments
 (0)