forked from leftypol/leftypol
config.php: better youtube embedding regex
This commit is contained in:
parent
3c282852a3
commit
d8cafc8fd8
1 changed files with 1 additions and 1 deletions
|
@ -1196,7 +1196,7 @@
|
||||||
// It's very important that you match the entire input (with ^ and $) or things will not work correctly.
|
// It's very important that you match the entire input (with ^ and $) or things will not work correctly.
|
||||||
$config['embedding'] = array(
|
$config['embedding'] = array(
|
||||||
[
|
[
|
||||||
'/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i',
|
'/^(?:(?:https?:)?\/\/)?((?:www|m)\.)?(?:(?:youtube(?:-nocookie)?\.com|youtu\.be))(?:\/(?:[\w\-]+\?v=|embed\/|live\/|v\/)?)([\w\-]{11})((?:\?|\&)\S+)?$/i',
|
||||||
'<div class="video-container" data-video-id="$2" data-iframe-width="360" data-iframe-height="202">
|
'<div class="video-container" data-video-id="$2" data-iframe-width="360" data-iframe-height="202">
|
||||||
<a href="https://youtu.be/$2" target="_blank" class="file">
|
<a href="https://youtu.be/$2" target="_blank" class="file">
|
||||||
<img style="width:360px;height:202px;object-fit:cover" src="https://img.youtube.com/vi/$2/0.jpg" class="post-image"/>
|
<img style="width:360px;height:202px;object-fit:cover" src="https://img.youtube.com/vi/$2/0.jpg" class="post-image"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue