fix: parse json theme string for standalone tag #1248

This commit is contained in:
Jonas Langhabel 2021-01-05 11:04:38 +01:00
parent 040ce72a8a
commit 556f6b82e6

View File

@ -32,7 +32,13 @@ function parseOptionsFromElement(element: Element) {
const res = {};
for (const attrName in attrMap) {
const optionName = attrName.replace(/-(.)/g, (_, $1) => $1.toUpperCase());
res[optionName] = attrMap[attrName];
let attr = attrMap[attrName];
if (attrName === 'theme') {
attr = JSON.parse(attr);
}
res[optionName] = attr;
// TODO: normalize options
}
return res;