mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-10 15:14:54 +03:00
fix: parse json theme string for standalone tag #1248
This commit is contained in:
parent
040ce72a8a
commit
556f6b82e6
|
@ -32,7 +32,13 @@ 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];
|
let attr = attrMap[attrName];
|
||||||
|
|
||||||
|
if (attrName === 'theme') {
|
||||||
|
attr = JSON.parse(attr);
|
||||||
|
}
|
||||||
|
|
||||||
|
res[optionName] = attr;
|
||||||
// TODO: normalize options
|
// TODO: normalize options
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user