Skip to content

Commit

Permalink
fix: add nocookie embled youtube url
Browse files Browse the repository at this point in the history
  • Loading branch information
genert committed Oct 20, 2018
1 parent 226a25b commit 8c52c54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/BBCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function addParser(string $name, string $pattern, string $replace, string

return $this;
}

public function addHtmlParser(string $name, string $pattern, string $replace, string $content)
{
$this->htmlParser->addParser($name, $pattern, $replace, $content);
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/BBCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ final class BBCodeParser extends Parser
],
'youtube' => [
'pattern' => '/\[youtube\](.*?)\[\/youtube\]/s',
'replace' => '<iframe width="560" height="315" src="//www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>',
'replace' => '<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/$1" frameborder="0" allowfullscreen></iframe>',
'content' => '$1'
],
'sub' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function testBBCodeReturnsCorrectHtml()
<li>Item 3</li>
</ol>
<code><?php echo \'Hello World\'; ?></code>
<iframe width="560" height="315" src="//www.youtube.com/embed/pnGJXuHDoYw" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/pnGJXuHDoYw" frameborder="0" allowfullscreen></iframe>
<ul>
<li>Item 1</li>
<li>Item 2</li>
Expand Down

0 comments on commit 8c52c54

Please sign in to comment.