Skip to content

Commit

Permalink
f Unicode bug in symfony crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
dusterio committed Mar 21, 2017
1 parent 48dc4e8 commit 81926bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Parsers/HtmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ protected function parseHtml(LinkInterface $link)
$images = [];

try {
$parser = new Crawler($link->getContent());
$parser = new Crawler();
$parser->addHtmlContent($link->getContent());

// Parse all known tags
foreach($this->tags as $tag => $selectors) {
Expand Down
4 changes: 2 additions & 2 deletions tests/LinkPreview/Tests/LinkPreviewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public function can_set_an_url()
*/
public function can_parse_a_youtube_link()
{
$linkPreview = new Client('https://www.youtube.com/watch?v=C0DPdy98e4c');
$linkPreview = new Client('https://www.youtube.com/watch?v=ycGfvA1vkR8');
$parsedLink = $linkPreview->getPreview('youtube');
self::assertInstanceOf('Dusterio\LinkPreview\Models\VideoPreview', $parsedLink);
}
}
}

0 comments on commit 81926bc

Please sign in to comment.