Skip to content

Commit d7a0a4d

Browse files
authored
fix: parse json theme string for standalone tag (#1492)
1 parent 22cc5f1 commit d7a0a4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/standalone.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ function parseOptionsFromElement(element: Element) {
3232
const res = {};
3333
for (const attrName in attrMap) {
3434
const optionName = attrName.replace(/-(.)/g, (_, $1) => $1.toUpperCase());
35-
res[optionName] = attrMap[attrName];
35+
const optionValue = attrMap[attrName];
36+
res[optionName] = attrName === 'theme' ? JSON.parse(optionValue) : optionValue;
3637
// TODO: normalize options
3738
}
3839
return res;

0 commit comments

Comments
 (0)