From f565e940386943cb062a3e93109cf79eddd89452 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 23 Jul 2020 15:15:16 -0700 Subject: [PATCH] update regex to handle p tags with inline styles --- TextformatterVideoEmbed.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TextformatterVideoEmbed.module b/TextformatterVideoEmbed.module index 6641a0c..9c3786f 100644 --- a/TextformatterVideoEmbed.module +++ b/TextformatterVideoEmbed.module @@ -162,7 +162,7 @@ class TextformatterVideoEmbed extends Textformatter implements ConfigurableModul && strpos($str, '://youtu.be/') === false) return; // 1: full URL 2:video id 3: query string (optional) - $regex = '#

\s*(https?://(?:www\.)?youtu(?:.be|be.com)+/(?:watch/?\?v=|v/)?([^\s&<\'"]+))(&[-_,.=&;a-zA-Z0-9]*)?.*?

#'; + $regex = '#]*>\s*(https?://(?:www\.)?youtu(?:.be|be.com)+/(?:watch/?\?v=|v/)?([^\s&<\'"]+))(&[-_,.=&;a-zA-Z0-9]*)?.*?

#'; if(!preg_match_all($regex, $str, $matches)) return; foreach($matches[0] as $key => $line) {