fix(substore): normalize mojibake flag prefixes
This commit is contained in:
+5
-1
@@ -5,7 +5,7 @@
|
||||
* - 基于归一化后的完整名称做精准去重
|
||||
*/
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
const COMMON_SCRIPT_URL = 'https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-3';
|
||||
const COMMON_SCRIPT_URL = 'https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-4';
|
||||
|
||||
async function loadRenameUtils() {
|
||||
if (typeof globalThis !== 'undefined' && globalThis.SubStoreRenameUtils) {
|
||||
@@ -581,6 +581,9 @@ async function operator(proxies) {
|
||||
const escapeRegex = utils.escapeRegex;
|
||||
const leadingFlagRegex = /^([\u{1F1E6}-\u{1F1FF}]{2}|🏴☠️)\s*/u;
|
||||
const inlineFlagRegex = /^(.{1,24}?)([\u{1F1E6}-\u{1F1FF}]{2}|🏴☠️)\s*(.*)$/u;
|
||||
const normalizeLeadingMojibakeFlag = utils.normalizeLeadingMojibakeFlag
|
||||
|| utils.stripLeadingMojibakeFlag
|
||||
|| (name => String(name).trim());
|
||||
|
||||
const flagToRegionCode = flag => utils.flagToRegionCode(flag, flagCodeOverrides);
|
||||
|
||||
@@ -726,6 +729,7 @@ async function operator(proxies) {
|
||||
};
|
||||
|
||||
const normalizeCoreName = name => {
|
||||
name = normalizeLeadingMojibakeFlag(name);
|
||||
const leadingFlagMatch = name.match(leadingFlagRegex);
|
||||
const inlineFlagMatch = leadingFlagMatch
|
||||
? null
|
||||
|
||||
Reference in New Issue
Block a user