We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c57cd1 commit 5766acdCopy full SHA for 5766acd
plugins/links/article/article.js
@@ -1,10 +1,18 @@
1
+import * as cheerio from 'cheerio';
2
+
3
export default {
4
- provides: 'articlebody',
5
+ provides: 'articlebody', // if not yet provided from LD articlebody
6
7
getData: function(__readabilityEnabled, readability, meta, utils) {
- return {
- articlebody: utils.encodeText(meta.charset, readability.getHTML())
8
9
+ const articleHtml = utils.encodeText(meta.charset, readability.getHTML());
10
+ const $p = cheerio.load(articleHtml)('p');
11
12
+ if ($p.text()) {
13
+ return {
14
+ articlebody: articleHtml
15
+ }
16
}
17
},
18
0 commit comments