From a1be32deebdc0a48502faacd798185e9a0d23888 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 18:58:48 +0000 Subject: [PATCH] style: auto format --- docs/government.md | 6 +++--- lib/v2/gov/sichuan/deyang/govpublicinfo.js | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/government.md b/docs/government.md index aee9c1703..41e32e72b 100644 --- a/docs/government.md +++ b/docs/government.md @@ -150,9 +150,9 @@ pageClass: routes -| 法定主动内容 | 公示公告 | -|:--------:|:----:| -| fdzdnr | gsgg | +| 法定主动内容 | 公示公告 | +| :----------: | :------: | +| fdzdnr | gsgg | diff --git a/lib/v2/gov/sichuan/deyang/govpublicinfo.js b/lib/v2/gov/sichuan/deyang/govpublicinfo.js index b7a7bedd1..bfd658c61 100644 --- a/lib/v2/gov/sichuan/deyang/govpublicinfo.js +++ b/lib/v2/gov/sichuan/deyang/govpublicinfo.js @@ -26,10 +26,12 @@ const getInfoUrlList = async (rootUrl, infoBasicUrl) => { const response = await got(infoBasicUrl); const $ = cheerio.load(response.data); // 非当前日期文章计数,部分旧文章可能会置顶,目前为发现置顶数超过10 - const infoList = $('body > div.container > div.ewb-white > div.ewb-job > ul > li').toArray().map((item) => ({ - title: $('a', item).attr('title'), - url: `${rootUrl}${$('a', item).attr('href')}`, - })); + const infoList = $('body > div.container > div.ewb-white > div.ewb-job > ul > li') + .toArray() + .map((item) => ({ + title: $('a', item).attr('title'), + url: `${rootUrl}${$('a', item).attr('href')}`, + })); return infoList; }; @@ -40,10 +42,12 @@ const getInfoContent = (ctx, rootUrl, item) => // 部分网页会跳转其他类型网站,则不解析,直接附超链接 try { const $ = cheerio.load(response.data); - const fileList = $('#symbol > div:nth-child(4) > div > span > a').toArray().map((item) => ({ - name: $(item).text(), - url: `${rootUrl}/${$(item).attr('href')}`, - })); + const fileList = $('#symbol > div:nth-child(4) > div > span > a') + .toArray() + .map((item) => ({ + name: $(item).text(), + url: `${rootUrl}/${$(item).attr('href')}`, + })); const rawDate = $('#symbol > div:nth-child(1) > div:nth-child(3)').text().split(':')[1].trim(); return { title: $('#main').text().trim(),