diff --git a/layout/includes/third-party/newest-comments/github-issues.pug b/layout/includes/third-party/newest-comments/github-issues.pug index e561f95..4b39308 100644 --- a/layout/includes/third-party/newest-comments/github-issues.pug +++ b/layout/includes/third-party/newest-comments/github-issues.pug @@ -15,15 +15,13 @@ script. } const findTrueUrl = (array) => { - let url = '' Promise.all(array.map(item => fetch(item.url).then(resp => resp.json()).then(data => { + const urlArray = data.body.match(/(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?/ig) if (data.user.login === 'utterances-bot') { - url = data.body.match(/https?\:\/\/[^\" ]+/ig).slice(-1) - return url[0] + return urlArray.pop() } else { - url = data.body.match(/https?\:\/\/[^\" ]+/i) - return url[0] + return urlArray.shift() } }) )).then(res => { diff --git a/package.json b/package.json index ac48e90..8260e35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "3.7.0", + "version": "3.7.1-b1", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": {