Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Commit 6af8331

Browse files
committed
Recognize https: URLs for YouTube, generate HTTPS in readme
1 parent 1f52e37 commit 6af8331

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

class-wordpress-readme-parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function to_markdown( $params = array() ) {
9191

9292
$general_section_formatter = function ( $body ) use ( $params ) {
9393
$body = preg_replace(
94-
'#\[youtube\s+(?:http://www\.youtube\.com/watch\?v=|http://youtu\.be/)(.+?)\]#',
95-
'[![Play video on YouTube](http://i1.ytimg.com/vi/$1/hqdefault.jpg)](http://www.youtube.com/watch?v=$1)',
94+
'#\[youtube\s+(?:https?://www\.youtube\.com/watch\?v=|https?://youtu\.be/)(.+?)\]#',
95+
'[![Play video on YouTube](https://i1.ytimg.com/vi/$1/hqdefault.jpg)](https://www.youtube.com/watch?v=$1)',
9696
$body
9797
);
9898
// Convert <pre lang="php"> into GitHub-flavored ```php markdown blocks

0 commit comments

Comments
 (0)