fix: parse json theme string for standalone tag (#1492)

This commit is contained in:
langhabel 2021-04-15 09:47:40 +02:00 committed by GitHub
parent 22cc5f17dc
commit d7a0a4da17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,8 @@ function parseOptionsFromElement(element: Element) {
const res = {}; const res = {};
for (const attrName in attrMap) { for (const attrName in attrMap) {
const optionName = attrName.replace(/-(.)/g, (_, $1) => $1.toUpperCase()); 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 // TODO: normalize options
} }
return res; return res;