luci-base: Code quality fixes
authorPaul Donald <newtwen@gmail.com>
Tue, 30 Jan 2024 18:31:38 +0000 (19:31 +0100)
committerPaul Donald <newtwen@gmail.com>
Wed, 31 Jan 2024 01:53:21 +0000 (02:53 +0100)
handle (possibly incorrect) comment variants
<!-- -->
<!-- --!>

Signed-off-by: Paul Donald <newtwen@gmail.com>
modules/luci-base/htdocs/luci-static/resources/ui.js

index 5502dfed25afc708e4a4239f33fb96b6ff11f8d1..98dc5add595ec112dcf35dd0dc8aa145af62b104 100644 (file)
@@ -1601,7 +1601,7 @@ var UIDropdown = UIElement.extend(/** @lends LuCI.ui.Dropdown.prototype */ {
                    markup = null;
 
                if (tpl)
-                       markup = (tpl.textContent || tpl.innerHTML || tpl.firstChild.data).replace(/^<!--|-->$/, '').trim();
+                       markup = (tpl.textContent || tpl.innerHTML || tpl.firstChild.data).replace(/^<!--|--!?>$/, '').trim();
                else
                        markup = '<li data-value="{{value}}"><span data-label-placeholder="true" /></li>';