diff --git a/package.json b/package.json index 29f94bcc..91786661 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@web-clipper/extensions": "^0.0.17", "@web-clipper/highlight": "^0.0.20", "@web-clipper/message-listener-combiner": "^0.1.0", - "@web-clipper/readability": "^0.2.1", + "@web-clipper/readability": "^0.3.0", "@web-clipper/remark-pangu": "^1.0.2", "@web-clipper/shared": "^0.0.20", "@web-clipper/turndown": "^0.4.0", diff --git a/src/extensions/extensions/readability.ts b/src/extensions/extensions/readability.ts index b7889caf..9f70054a 100644 --- a/src/extensions/extensions/readability.ts +++ b/src/extensions/extensions/readability.ts @@ -17,7 +17,9 @@ export default new TextExtension( $(documentClone) .find('#skPlayer') .remove(); - let article = new Readability(documentClone).parse(); + let article = new Readability(documentClone, { + keepClasses: true, + }).parse(); return turndown.turndown(article.content); }, } diff --git a/src/service/contentScript/browser/contentScript/contentScript.ts b/src/service/contentScript/browser/contentScript/contentScript.ts index 24381a9a..ca3e4abc 100644 --- a/src/service/contentScript/browser/contentScript/contentScript.ts +++ b/src/service/contentScript/browser/contentScript/contentScript.ts @@ -3,7 +3,7 @@ import { Service, Inject } from 'typedi'; import styles from '@/service/contentScript/browser/contentScript/contentScript.less'; import * as browser from '@web-clipper/chrome-promise'; import * as QRCode from 'qrcode'; -import * as Readability from '@web-clipper/readability'; +import { Readability } from '@web-clipper/readability'; import AreaSelector from '@web-clipper/area-selector'; import Highlighter from '@web-clipper/highlight'; import plugins from '@web-clipper/turndown'; diff --git a/yarn.lock b/yarn.lock index 3d1f6cce..a95f0e3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -951,10 +951,10 @@ dependencies: dva-model-creator "^0.3.0" -"@web-clipper/readability@^0.2.1": - version "0.2.1" - resolved "https://registry.npm.taobao.org/@web-clipper/readability/download/@web-clipper/readability-0.2.1.tgz#1aef4b09d805c377ebf2aa61a20085876faa8221" - integrity sha1-Gu9LCdgFw3fr8qphogCFh2+qgiE= +"@web-clipper/readability@^0.3.0": + version "0.3.0" + resolved "https://registry.npm.taobao.org/@web-clipper/readability/download/@web-clipper/readability-0.3.0.tgz?cache=0&sync_timestamp=1597248627380&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40web-clipper%2Freadability%2Fdownload%2F%40web-clipper%2Freadability-0.3.0.tgz#d8e8201fe4bedbea3a0d2e4281e02f22092adc33" + integrity sha1-2OggH+S+2+o6DS5CgeAvIgkq3DM= "@web-clipper/remark-pangu@^1.0.2": version "1.0.2"