mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
Update src/standalone.tsx
This commit is contained in:
parent
556f6b82e6
commit
419dbc71f0
|
@ -32,13 +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());
|
||||||
let attr = attrMap[attrName];
|
const attr = attrMap[attrName];
|
||||||
|
res[optionName] = attrName === 'theme' ? JSON.parse(attr) : attr;
|
||||||
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