mirror of
https://gitee.com/onvia/ccc-tnt-psd2ui
synced 2025-10-13 10:38:33 +00:00
增加移除规则标记末尾的中文
This commit is contained in:
7
psd2ui-tools/dist/index.js
vendored
7
psd2ui-tools/dist/index.js
vendored
@@ -1256,11 +1256,14 @@
|
||||
return obj;
|
||||
}
|
||||
removeChineseFromEnd(inputString) {
|
||||
if (!inputString) {
|
||||
return inputString;
|
||||
}
|
||||
const chineseRegex = /[\u4e00-\u9fa5]+$/;
|
||||
const match = inputString.match(chineseRegex);
|
||||
const match = inputString.trim().match(chineseRegex);
|
||||
if (match && match[0]) {
|
||||
const chineseLength = match[0].length;
|
||||
return inputString.slice(0, -chineseLength);
|
||||
return this.removeChineseFromEnd(inputString.slice(0, -chineseLength));
|
||||
}
|
||||
return inputString;
|
||||
}
|
||||
|
Reference in New Issue
Block a user