From 35c3ae05b93aeca48aded7d7adc2d169be8c6672 Mon Sep 17 00:00:00 2001 From: Mark Herwege Date: Mon, 25 Sep 2023 22:24:54 +0200 Subject: [PATCH] Sitemap editor: Trim spaces from color value (#2091) When generating the sitemap DSL from a UI configured sitemap with color conditions, if the color in the condition has a leading space, it will be included in the color string. While this does not have an impact on the sitemap functionality (it works), it is an issue if one would copy this sitemap to a sitemap file. This PR strips the blanks from the color. See #2082 and the example provided there. Signed-off-by: Mark Herwege --- .../web/src/components/pagedesigner/sitemap/dslUtil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/components/pagedesigner/sitemap/dslUtil.js b/bundles/org.openhab.ui/web/src/components/pagedesigner/sitemap/dslUtil.js index 85c78cb114..604cb3ba6e 100644 --- a/bundles/org.openhab.ui/web/src/components/pagedesigner/sitemap/dslUtil.js +++ b/bundles/org.openhab.ui/web/src/components/pagedesigner/sitemap/dslUtil.js @@ -41,7 +41,7 @@ function writeWidget (widget, indent) { dsl += '[' dsl += widget.config[key].filter(Boolean).map(color => { let index = color.lastIndexOf('=') + 1 - let colorvalue = color.substring(index) + let colorvalue = color.substring(index).trim() if (!/^(".*")|('.*')$/.test(colorvalue)) { colorvalue = '"' + colorvalue + '"' }