[fix] js unexpected token (#534)

This commit is contained in:
星日语 2024-10-25 21:20:18 +08:00 committed by GitHub
parent 0628fc9478
commit ab1f133d81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View File

@ -19,7 +19,7 @@ utils.jq(() => {
var cell = '<div class="timenode" index="' + i + '">';
cell += '<div class="header">';
cell += '<div class="user-info">';
cell += '<img src="' + (item.author.avatarUrl || default_avatar) + '" onerror="javascript:this.src=\\'' + default_avatar + '\\';">';
cell += '<img src="' + (item.author.avatarUrl || default_avatar) + '" onerror="javascript:this.src=\'' + default_avatar + '\';">';
cell += '<span>' + item.author.login + '</span>';
cell += '</div>';
cell += '<span>' + new Date(item.createdAt).toLocaleString() + '</span>';
@ -33,5 +33,4 @@ utils.jq(() => {
});
}
});
});
});

View File

@ -15,13 +15,13 @@ utils.jq(() => {
var cell = '<div class="timenode" index="' + i + '">';
cell += '<div class="header">';
cell += '<div class="user-info">';
cell += '<img src="' + (item.avatar || default_avatar) + '" onerror="javascript:this.src=\\'' + default_avatar + '\\';">';
cell += '<img src="' + (item.avatar || default_avatar) + '" onerror="javascript:this.src=\'' + default_avatar + '\';">';
cell += '<span>' + item.nick + '</span>';
cell += '</div>';
cell += '<span>' + new Date(item.time).toLocaleString() + '</span>';
cell += '</div>';
cell += '<a class="body" href="' + item.url + '#' + item.objectId + '" target="_blank" rel="external nofollow noopener noreferrer">';
cell += item.comment.replace(/<a\\b[^>]*>(.*?)<\\/a>/g, '$1');
cell += item.comment.replace(/<a\b[^>]*>(.*?)<\/a>/g, '$1');
cell += '</a>';
cell += '</div>';
$(el).append(cell);
@ -29,5 +29,4 @@ utils.jq(() => {
});
}
});
});
});