Skip to content

Commit

Permalink
Recognize Sina Weibo meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
da2x authored and gijsk committed Aug 28, 2018
1 parent 5a69d4a commit 3be1aaa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ Readability.prototype = {
var propertyPattern = /\s*(dc|dcterm|og|twitter)\s*:\s*(author|creator|description|title)\s*/gi;

// name is a single value
var namePattern = /^\s*(?:(dc|dcterm|og|twitter)\s*[\.:]\s*)?(author|creator|description|title)\s*$/i;
var namePattern = /^\s*(?:(dc|dcterm|og|twitter|weibo:(article|webpage))\s*[\.:]\s*)?(author|creator|description|title)\s*$/i;

// Find description tags.
this._forEachNode(metaElements, function(element) {
Expand Down Expand Up @@ -1239,6 +1239,8 @@ Readability.prototype = {
metadata.title = values["dc:title"] ||
values["dcterm:title"] ||
values["og:title"] ||
values["weibo:article:title"] ||
values["weibo:webpage:title"] ||
values["title"] ||
values["twitter:title"];

Expand All @@ -1255,6 +1257,8 @@ Readability.prototype = {
metadata.excerpt = values["dc:description"] ||
values["dcterm:description"] ||
values["og:description"] ||
values["weibo:article:description"] ||
values["weibo:webpage:description"] ||
values["description"] ||
values["twitter:description"];

Expand Down

0 comments on commit 3be1aaa

Please sign in to comment.