diff --git a/packages/content-handler/src/websites/weixin-qq-handler.ts b/packages/content-handler/src/websites/weixin-qq-handler.ts index 4ac93c4e3..8dac19e51 100644 --- a/packages/content-handler/src/websites/weixin-qq-handler.ts +++ b/packages/content-handler/src/websites/weixin-qq-handler.ts @@ -15,7 +15,7 @@ export class WeixinQqHandler extends ContentHandler { // Retrieve the publish time const publishTime = dom.querySelector('#publish_time')?.textContent if (publishTime) { - const dateTimeFormat = 'yyyy-LL-dd HH:mm' + const dateTimeFormat = 'yyyy年LL月dd日 HH:mm' // published time is in UTC+8 const publishTimeISO = DateTime.fromFormat(publishTime, dateTimeFormat, { zone: 'Asia/Shanghai', @@ -27,16 +27,25 @@ export class WeixinQqHandler extends ContentHandler { metaNode.setAttribute('content', publishTimeISO) dom.querySelector('head')?.appendChild(metaNode) } - // This replace the class name of the article info to preserve the block - dom - .querySelector('.rich_media_meta_list') - ?.setAttribute('class', '_omnivore_rich_media_meta_list') - // This removes the title + const author = ( + dom.querySelector('#js_author_name') || dom.querySelector('#js_name') + )?.textContent?.trim() + if (author) { + const authorNode = dom.createElement('meta') + authorNode.setAttribute('name', 'author') + authorNode.setAttribute('content', author) + dom.querySelector('head')?.appendChild(authorNode) + } + + // This removes the title, metadata and cover image dom.querySelector('.rich_media_title')?.remove() + dom.querySelector('.rich_media_meta_list')?.remove() + dom.querySelector('#js_row_immersive_cover_img')?.remove() // This removes the profile info dom.querySelector('.profile_container')?.remove() + dom.querySelector('.profile_card_container')?.remove() // This removes the footer dom.querySelector('#content_bottom_area')?.remove() diff --git a/packages/readabilityjs/Readability.js b/packages/readabilityjs/Readability.js index 354c2e8e8..6799eb5da 100644 --- a/packages/readabilityjs/Readability.js +++ b/packages/readabilityjs/Readability.js @@ -2007,6 +2007,7 @@ Readability.prototype = { metadata.byline = jsonld.byline || values["dc:creator"] || values["dcterm:creator"] || + values["og:article:author"] || values["author"]; // get description