From e4f8c88e1ececda301760a701b4d7f7f9bb7e780 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 21 Jul 2022 11:32:37 -0600 Subject: [PATCH] Map template attribute size="#" => width="#ex" to avoid conflict with Shoelace size attribute --- api/etemplate.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/etemplate.php b/api/etemplate.php index a5c1025106..5df2b06674 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -183,6 +183,12 @@ function send_template() ) . ">"; }, $str); + // Change size=# attribute to width, size is small|medium|large with shoelace + $str = preg_replace_callback('#<([^/>]+) size="([[:digit:]]+)"([^/>]+?)/>#su', static function ($matches) + { + return "<{$matches[1]} width=\"{$matches[2]}ex\" {$matches[3]}/>"; + }, $str); + // handling of select and taglist widget, incl. removing of type attribute $str = preg_replace_callback('#<(select|taglist|listbox)(-[^ ]+)? ([^>]+?)(/|>(.*?)#s', static function (array $matches) {