Skip to content

Commit

Permalink
fix: parse json theme string for standalone tag (#1492)
Browse files Browse the repository at this point in the history
  • Loading branch information
langhabel authored Apr 15, 2021
1 parent 22cc5f1 commit d7a0a4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/standalone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d7a0a4d

Please sign in to comment.