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>
Sat, 3 Feb 2024 15:14:09 +0000 (16:14 +0100)
handle (possibly incorrect) comment variants
<!-- -->
<!-- --!>

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 4c2090afd865045e3693b84318de3b56f658e48a)

modules/luci-base/htdocs/luci-static/resources/ui.js

index 29810d57986bf117c83013e0d0f488c03c9b46d6..e2b993b0e2e515d05eee125c458f3147ed3a1f62 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>';