From d7a0a4da17241dd9c089202dba76a8312248616e Mon Sep 17 00:00:00 2001 From: langhabel Date: Thu, 15 Apr 2021 09:47:40 +0200 Subject: [PATCH] fix: parse json theme string for standalone tag (#1492) --- src/standalone.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/standalone.tsx b/src/standalone.tsx index f0eda0b126..12b65daa60 100644 --- a/src/standalone.tsx +++ b/src/standalone.tsx @@ -32,7 +32,8 @@ function parseOptionsFromElement(element: Element) { const res = {}; for (const attrName in attrMap) { const optionName = attrName.replace(/-(.)/g, (_, $1) => $1.toUpperCase()); - res[optionName] = attrMap[attrName]; + const optionValue = attrMap[attrName]; + res[optionName] = attrName === 'theme' ? JSON.parse(optionValue) : optionValue; // TODO: normalize options } return res;