chore(deps-dev): bump prettier from 1.19.1 to 2.0.2

This commit is contained in:
DIYgod
2020-04-02 21:21:46 +08:00
parent 27e4a7c151
commit 0e7b14e718
471 changed files with 1237 additions and 4457 deletions

View File

@@ -16,17 +16,11 @@ module.exports = async (ctx) => {
const list = $('div.news-item.stream__item.clearfix.mt15')
.slice(0, 10)
.map(function() {
.map(function () {
const info = {
link: $(this)
.find('div.news__item-info.clearfix a')
.attr('href'),
title: $(this)
.find('div.mb5.mt5 h4')
.text(),
author: $(this)
.find('span.author.pr20 a')
.text(),
link: $(this).find('div.news__item-info.clearfix a').attr('href'),
title: $(this).find('div.mb5.mt5 h4').text(),
author: $(this).find('span.author.pr20 a').text(),
};
return info;
})
@@ -51,18 +45,13 @@ module.exports = async (ctx) => {
if (info.link.indexOf('p') !== -1) {
// 分享
description =
$('div.fmt.mb10')
.html()
.trim() +
$('div.fmt.mb10').html().trim() +
$('div.content h3')
.html()
.replace(/href="\//g, `href="${url.resolve(host, '.')}`)
.trim();
const date_list = $('div.news__item-info > p > span')
.text()
.trim()
.split(' ');
const date_list = $('div.news__item-info > p > span').text().trim().split(' ');
date_list.shift();
let date_v = '';
if (date_list.length > 1) {
@@ -77,10 +66,7 @@ module.exports = async (ctx) => {
.html()
.replace(/data-src="/g, 'src="https://segmentfault.com')
.trim();
const date_v = $('div.article__authorright > span')
.text()
.trim()
.replace(' ', '');
const date_v = $('div.article__authorright > span').text().trim().replace(' ', '');
date_value = date_v.substring(0, date_v.length - 2);
}