diff --git a/scripts/main.js b/scripts/main.js index abb9cf5..7dc34f5 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -413,19 +413,20 @@ const pre_list = ((e) => { else dom += `
${category}`; let content; // 生成元素 - for (const [title, url, description, autoLang] of block[category]) { + for (const [_title, url, description, autoLang] of block[category]) { let template = '|DOM|'; - if (autoLang && description) template = `|DOM|`; + if (autoLang && description != '') template = `|DOM|`; else if (description) template = `|DOM|`; + const title = autoLang ? `al="${_title}">` : `>${_title}`; // 判断是否为内部链接 if (url.startsWith('#')) { // 内部链接 - content = `${title}`; + content = ``; } else { // 外部链接 if (importantPattern.test(title)) { - content = `${title.replace(importantPattern, '$1')}`; - } else content = `${title}`; + content = `$1')}`; + } else content = ``; }; dom += template.replace('|DOM|', content); };