From 01cc32a0cc92d8b76ac2d181f974d1f8e1f95a1d Mon Sep 17 00:00:00 2001 From: ORelio Date: Wed, 25 Mar 2020 23:28:42 +0100 Subject: [PATCH] [Markdown] Fix images with empty replacement text --- lib/html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/html.php b/lib/html.php index 13db97a4..c56140bf 100644 --- a/lib/html.php +++ b/lib/html.php @@ -207,7 +207,7 @@ function markdownToHtml($string) { //For more details about how these regex work: // https://github.com/RSS-Bridge/rss-bridge/pull/802#discussion_r216138702 - // Images: https://regex101.com/r/JW9Evr/1 + // Images: https://regex101.com/r/JW9Evr/2 // Links: https://regex101.com/r/eRGVe7/1 // Bold: https://regex101.com/r/2p40Y0/1 // Italic: https://regex101.com/r/xJkET9/1 @@ -215,7 +215,7 @@ function markdownToHtml($string) { // Plain URL: https://regex101.com/r/2JHYwb/1 // Site name: https://regex101.com/r/qIuKYE/1 - $string = preg_replace('/\!\[([^\]]+)\]\(([^\) ]+)(?: [^\)]+)?\)/', '$1', $string); + $string = preg_replace('/\!\[([^\]]*)\]\(([^\) ]+)(?: [^\)]+)?\)/', '$1', $string); $string = preg_replace('/\[([^\]]+)\]\(([^\)]+)\)/', '$1', $string); $string = preg_replace('/\*\*(.*)\*\*/U', '$1', $string); $string = preg_replace('/\*(.*)\*/U', '$1', $string);