diff --git a/packages/mermaid/src/diagrams/common/populateCommonDb.ts b/packages/mermaid/src/diagrams/common/populateCommonDb.ts index f0e4dcdb3..dd8610dce 100644 --- a/packages/mermaid/src/diagrams/common/populateCommonDb.ts +++ b/packages/mermaid/src/diagrams/common/populateCommonDb.ts @@ -3,7 +3,13 @@ import type { DiagramAST } from 'mermaid-parser'; import type { DiagramDB } from '../../diagram-api/types.js'; export function populateCommonDb(ast: DiagramAST, db: DiagramDB) { - ast.accDescr && db.setAccDescription?.(ast.accDescr); - ast.accTitle && db.setAccTitle?.(ast.accTitle); - ast.title && db.setDiagramTitle?.(ast.title); + if (ast.accDescr) { + db.setAccDescription?.(ast.accDescr); + } + if (ast.accTitle) { + db.setAccTitle?.(ast.accTitle); + } + if (ast.title) { + db.setDiagramTitle?.(ast.title); + } }