Skip to content

Commit

Permalink
fix text avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
solstice23 committed Aug 9, 2021
1 parent 9543e44 commit 7ef2256
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion argontheme.js
Expand Up @@ -1264,7 +1264,12 @@ $(document).on("click" , ".show-full-comment" , function(){
});
/*评论文字头像*/
function generateCommentTextAvatar(img){
let emailHash = img.attr("src").match(/([a-f\d]{32}|[A-F\d]{32})/)[0];
let emailHash = '';
try{
emailHash = img.attr("src").match(/([a-f\d]{32}|[A-F\d]{32})/)[0];
}catch{
emailHash = img.parent().parent().parent().find("comment-name").text().trim();
}
let hash = 0;
for (i in emailHash){
hash = (hash * 233 + emailHash.charCodeAt(i)) % 16;
Expand Down

0 comments on commit 7ef2256

Please sign in to comment.