mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-02-04 07:13:25 +08:00
Properly handle wrong theme name
This commit is contained in:
parent
2d560861df
commit
9913bf654b
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "8.0.0-beta.1",
|
"version": "8.0.0-beta.2",
|
||||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"main": "dist/mermaid.core.js",
|
"main": "dist/mermaid.core.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -382,7 +382,10 @@ const render = function (id, txt, cb, container) {
|
|||||||
const firstChild = svg.firstChild
|
const firstChild = svg.firstChild
|
||||||
|
|
||||||
// pre-defined theme
|
// pre-defined theme
|
||||||
let style = config.theme !== undefined ? themes[config.theme] : ''
|
let style = themes[config.theme]
|
||||||
|
if (style === undefined) {
|
||||||
|
style = ''
|
||||||
|
}
|
||||||
|
|
||||||
// user provided theme CSS
|
// user provided theme CSS
|
||||||
if (config.themeCSS !== undefined) {
|
if (config.themeCSS !== undefined) {
|
||||||
@ -441,7 +444,7 @@ const setConf = function (cnf) {
|
|||||||
// Top level initially mermaid, gflow, sequenceDiagram and gantt
|
// Top level initially mermaid, gflow, sequenceDiagram and gantt
|
||||||
const lvl1Keys = Object.keys(cnf)
|
const lvl1Keys = Object.keys(cnf)
|
||||||
for (let i = 0; i < lvl1Keys.length; i++) {
|
for (let i = 0; i < lvl1Keys.length; i++) {
|
||||||
if (typeof cnf[lvl1Keys[i]] === 'object') {
|
if (typeof cnf[lvl1Keys[i]] === 'object' && cnf[lvl1Keys[i]] != null) {
|
||||||
const lvl2Keys = Object.keys(cnf[lvl1Keys[i]])
|
const lvl2Keys = Object.keys(cnf[lvl1Keys[i]])
|
||||||
|
|
||||||
for (let j = 0; j < lvl2Keys.length; j++) {
|
for (let j = 0; j < lvl2Keys.length; j++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user