From 6e8057a1c37baaa04d7a59403fdd5da775e3cf18 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 3 Aug 2019 11:48:47 +0000 Subject: [PATCH] Respecting the "alt" description of images during import from HTML --- src/Content/Text/HTML.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 4be217b3e4..9f614a90c3 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -290,6 +290,7 @@ class HTML self::tagToBBCode($doc, 'a', ['href' => '/mailto:(.+)/'], '[mail=$1]', '[/mail]'); self::tagToBBCode($doc, 'a', ['href' => '/(.+)/'], '[url=$1]', '[/url]'); + self::tagToBBCode($doc, 'img', ['src' => '/(.+)/', 'alt' => '/(.+)/'], '[img=$1]$2', '[/img]'); self::tagToBBCode($doc, 'img', ['src' => '/(.+)/', 'width' => '/(\d+)/', 'height' => '/(\d+)/'], '[img=$2x$3]$1', '[/img]'); self::tagToBBCode($doc, 'img', ['src' => '/(.+)/'], '[img]$1', '[/img]');