From c8a28137e0ffab3d62be45205bde011ffe40f91b Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:28:38 +0000 Subject: [PATCH] Fix numeric series parsing Closes #3043 --- public/scripts/variables.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/scripts/variables.js b/public/scripts/variables.js index a2306d7b5..df22db8ad 100644 --- a/public/scripts/variables.js +++ b/public/scripts/variables.js @@ -641,9 +641,15 @@ function parseNumericSeries(value, scope = null) { /** @type {(string|number)[]} */ let values = Array.isArray(value) ? value : value.split(' '); - // If a JSON array was provided as the only value, convert it to an array - if (values.length === 1 && typeof values[0] === 'string' && values[0].startsWith('[')) { - values = convertValueType(values[0], 'array'); + // If an array of strings was provided as the only value, convert it to an array + if (values.length === 1 && typeof values[0] === 'string') { + if (values[0].startsWith('[')) { + // JSON-style array + values = convertValueType(values[0], 'array'); + } else { + // Space-separated string + values = values[0].split(' '); + } } const array = values.map(i => typeof i === 'string' ? i.trim() : i)