Merge pull request #7463 from annando/alt-description

Respecting the "alt" description of images during import from HTML
This commit is contained in:
Hypolite Petovan 2019-08-04 10:34:20 -04:00 committed by GitHub
commit 858f210c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]');