Do not drop the size attribute if we are setting new shoelace size format

This commit is contained in:
Hadi Nategh 2022-08-22 13:29:08 +02:00
parent 55d540defd
commit bcf9d6b937

View File

@ -393,7 +393,8 @@ function send_template()
} }
// Change size=# attribute to width, size is small|medium|large with Shoelace // Change size=# attribute to width, size is small|medium|large with Shoelace
if (isset($attrs['size'])) // Do not drop size if we're setting shoelace size format in the template
if (isset($attrs['size']) && !preg_match('/small|medium|large/',$attrs['size']))
{ {
$attrs['width'] = (int)$attrs['size'].'em'; $attrs['width'] = (int)$attrs['size'].'em';
unset($attrs['size']); unset($attrs['size']);