]> _ Git - cubist_util.git/commitdiff
wip #8039 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 Mar 2026 16:02:09 +0000 (17:02 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 Mar 2026 16:02:09 +0000 (17:02 +0100)
src/Markdown.php

index 9211b376c7c41fa8e9b15f9cb47887af7309a83e..2eba9c87f71cf60d4c3706250f5f69c4e97b0af4 100644 (file)
@@ -15,6 +15,10 @@ class Markdown
         if (!$md) {
             return "";
         }
+        if(!$images){
+            $md=preg_replace('/!\[[^]]*]\([^)]*\)/','',$md);
+        }
+
         $config = [
             'table' => [
                 'wrap' => [
@@ -39,7 +43,7 @@ class Markdown
 
         $h = $converter->convert($md)->getContent();
         if (!$images) {
-            $h = preg_replace('/<p><img.*<\/p>/U', '', $h);
+            $h = preg_replace('/<p><img[^>]*\/><\/p>/U', '', $h);
             $h = str_replace("/\n+/", "\n", $h);
         }
         return $h;