「MediaWiki:Gadget-tradsim-trad2simcore.js」:修訂間差異
跳至導覽
跳至搜尋
無編輯摘要
imported>=海豚= 無編輯摘要 |
imported>=海豚= 無編輯摘要 |
||
| 行 3: | 行 3: | ||
window.newtrad2simcore = function newtrad2simcore(str){ | window.newtrad2simcore = function newtrad2simcore(str){ | ||
var zh2hansTable={ | var zh2hansTable={ | ||
"`”":"@」", | |||
"`“":"@「", | "`“":"@「", | ||
"`’":"@』", | "`’":"@』", | ||
| 行 3,816: | 行 3,816: | ||
}; | }; | ||
str=str.replace(/([^\u0000-\u1f00])/g,"`$1"); | str=str.replace(/([^\u0000-\u1f00])/g,"`$1"); | ||
str=str.replace(/`[^\u0000-\u1f00]/g, function repTable(s){return (zh2hansTable[s] || s);}); | str=str.replace(/`[^\u0000-\u1f00]/g, function repTable(s){return (zh2hansTable[s] || s);}); | ||
str=str.replace(/[@`]([^\u0000-\u1f00])/g,"$1"); | str=str.replace(/[@`]([^\u0000-\u1f00])/g,"$1"); | ||
return str; | return str; | ||
}; | }; | ||