sitemap: strip images from teaser
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 17 May 2020 03:50:17 +0000 (05:50 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 5 Dec 2020 00:38:53 +0000 (01:38 +0100)
Fix duplicate display of early images.

widget/linkref.php

index 1ac38864e15874727104fed296f9e1056ca33067..75135f85c1d23d00d4f71a51fd74d1a88f020159 100644 (file)
@@ -5,7 +5,9 @@
                printf("\n\t".'<img class="right" src="/%s" />', $article->thumb('100x100'));
        }
        if ($article->teaser) {
-               printf("\n\t<blockquote>%s</blockquote>",
-                       preg_replace('/\n(.*)/s', ' <small>\1</small>', $article->teaser)
-               );
+               printf("\n\t<blockquote>%s</blockquote>", preg_replace(
+                       ['/\n(.*)/s', '/<img[^>]*>/'],
+                       [' <small>\1</small>', ''],
+                       $article->teaser
+               ));
        }