Skip to content

Commit

Permalink
Fix issue with remove youtube videos from NovyDenikNewsfilters
Browse files Browse the repository at this point in the history
If youtube video was embeded in newsfilter, it was removed with all text
until following `<a>` element. Regexp was too greedy.

Using same fix that helped with anchors remp/remp@4499f572ecfd1df990602c6fff1112f5a38062b0

remp/helpdesk#3096
  • Loading branch information
markoph committed Oct 22, 2024
1 parent 8ef9412 commit 4e17162
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function process(array $values): array
$meta = $this->content->fetchUrlMeta($url);
return '<a href="' . $url . '" style="padding:0;margin:0;line-height:1.3;color:#F26755;text-decoration:none;">' . $meta->getTitle() . '</a>';
},
'/<a.*?href="(.*?)".*?>(.*?)<\/a>/is' => '<a href="$1" style="padding:0;margin:0;line-height:1.3;color:#b00c28;text-decoration:none;">$2</a>',
'/<a\s[^>]*href="(.*?)".*?>(.*?)<\/a>/is' => '<a href="$1" style="padding:0;margin:0;line-height:1.3;color:#b00c28;text-decoration:none;">$2</a>',
'/<p.*?>(.*?)<\/p>/is' => "<p style=\"font-weight: normal;\">$1</p>",
];
$rules = $this->getRules($generatorRules);
Expand Down

0 comments on commit 4e17162

Please sign in to comment.