Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

Commit 23f2175

Browse files
authored
Merge pull request #73 from andreskrey/development
v2.0.1
2 parents e1b31f9 + b04fa77 commit 23f2175

File tree

153 files changed

+922
-422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+922
-422
lines changed

src/Readability.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ private function getMetadata()
287287

288288
$values = [];
289289
// property is a space-separated list of values
290-
$propertyPattern = '/\s*(dc|dcterm|og|twitter)\s*:\s*(author|creator|description|title)\s*/i';
290+
$propertyPattern = '/\s*(dc|dcterm|og|twitter)\s*:\s*(author|creator|description|title|image)\s*/i';
291291

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

295295
// Find description tags.
296296
foreach ($this->dom->getElementsByTagName('meta') as $meta) {

test/ReadabilityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testHTMLParserParsesImages($html, $expectedResult, $expectedMeta
5959
$readability = new Readability($configuration);
6060
$readability->parse($html);
6161

62-
$this->assertSame($expectedImages, json_encode($readability->getImages()));
62+
$this->assertSame(json_decode($expectedImages, true), $readability->getImages());
6363
}
6464

6565
public function getSamplePages()
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
["http:\/\/fakehost\/static\/code\/2013\/blanket-coverage.png"]
1+
[
2+
"http:\/\/fakehost\/static\/code\/2013\/blanket-coverage.png"
3+
]
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"Title": "Get your Frontend JavaScript Code Covered | Code",
3-
"Author": "Nicolas Perriault —",
4-
"Excerpt": "Nicolas Perriault's homepage."
5-
}
2+
"Title": "Get your Frontend JavaScript Code Covered | Code",
3+
"Author": "Nicolas Perriault —",
4+
"Excerpt": "Nicolas Perriault's homepage.",
5+
"Direction": null,
6+
"Image": null
7+
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"Title": "This API is so Fetching!",
3-
"Author": "Nikhil Marathe",
4-
"Excerpt": "For more than a decade the Web has used XMLHttpRequest (XHR) to achieve asynchronous requests in JavaScript. While very useful, XHR is not a very ..."
5-
}
2+
"Title": "This API is so Fetching!",
3+
"Author": "Nikhil Marathe",
4+
"Excerpt": "For more than a decade the Web has used XMLHttpRequest (XHR) to achieve asynchronous requests in JavaScript. While very useful, XHR is not a very ...",
5+
"Direction": null,
6+
"Image": null
7+
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"Title": "Dublin Core property title",
3-
"Author": "Dublin Core property author",
4-
"Excerpt": "Dublin Core property description"
5-
}
2+
"Title": "Dublin Core property title",
3+
"Author": "Dublin Core property author",
4+
"Excerpt": "Dublin Core property description",
5+
"Direction": null,
6+
"Image": null
7+
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"Title": "Preferred title",
3-
"Author": "Creator Name",
4-
"Excerpt": "Preferred description"
5-
}
2+
"Title": "Preferred title",
3+
"Author": "Creator Name",
4+
"Excerpt": "Preferred description",
5+
"Direction": null,
6+
"Image": null
7+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
[]
1+
[
2+
"https:\/\/www.aclu.org\/sites\/default\/files\/styles\/metatag_og_image_1200x630\/public\/field_share_image\/web18-facebook-socialshare-1200x628-v02.png?itok=p77cQjOm"
3+
]
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"Title": "Facebook Is Tracking Me Even Though I’m Not on Facebook",
3-
"Author": "By Daniel Kahn Gillmor, Senior Staff Technologist, ACLU Speech, Privacy, and Technology Project",
4-
"Excerpt": "I don't use Facebook. I'm not technophobic — I'm a geek. I've been using email since the early 1990s, I have accounts on hundreds of services around the net, and I do software development and internet protocol design both for work and for fun. I believe that a globe-spanning communications network like the internet can be a positive social force, and I publish much of my own work on the open web."
5-
}
2+
"Title": "Facebook Is Tracking Me Even Though I’m Not on Facebook",
3+
"Author": "By Daniel Kahn Gillmor, Senior Staff Technologist, ACLU Speech, Privacy, and Technology Project",
4+
"Excerpt": "I don't use Facebook. I'm not technophobic — I'm a geek. I've been using email since the early 1990s, I have accounts on hundreds of services around the net, and I do software development and internet protocol design both for work and for fun. I believe that a globe-spanning communications network like the internet can be a positive social force, and I publish much of my own work on the open web.",
5+
"Image": "https:\/\/www.aclu.org\/sites\/default\/files\/styles\/metatag_og_image_1200x630\/public\/field_share_image\/web18-facebook-socialshare-1200x628-v02.png?itok=p77cQjOm",
6+
"Direction": "ltr"
7+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
["http:\/\/cdn.arstechnica.net\/wp-content\/uploads\/2015\/04\/server-crash-640x426.jpg"]
1+
[
2+
"http:\/\/cdn.arstechnica.net\/wp-content\/uploads\/2015\/04\/server-crash-640x426.jpg"
3+
]

0 commit comments

Comments
 (0)