Skip to content

Commit

Permalink
fix: external or not
Browse files Browse the repository at this point in the history
  • Loading branch information
teaSummer committed Aug 13, 2024
1 parent 045a2a7 commit c2db281
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,15 @@ const pre_list = ((e) => {
// 生成元素
for (const [_title, url, description, autoLang] of block[category]) {
let template = '|DOM|';
const title = autoLang ? `al="${_title}">` : `>${_title}`;
if (autoLang && description != '') template = `<mdui-tooltip al-aplto="content: ${description};" placement="top">|DOM|</mdui-tooltip>`;
else if (description) template = `<mdui-tooltip content="${description}" placement="top">|DOM|</mdui-tooltip>`;
const title = autoLang ? `al="${_title}">` : `>${_title}`;
// 判断是否为内部链接
if (url.startsWith('#')) {
// 内部链接
content = `<a class="button noicon" href="${url}" onclick="hashChanged();" ${title}</a>`;
// 找不到合适的外部链接
if (url == '#') content = `<a class="button noicon" ${title}</a>`;
} else {
// 外部链接
if (importantPattern.test(title)) {
Expand Down

0 comments on commit c2db281

Please sign in to comment.