From 469d0f87be7096bbdbec73bb79c5c75c01151609 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Tue, 1 Nov 2022 10:12:48 -0700 Subject: [PATCH] merge fix: get classDefs only if diagram is in CLASSDEF_DIAGRAMS --- packages/mermaid/src/mermaidAPI.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index 44b92e88c..805e42f1a 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -181,8 +181,8 @@ export const createCssStyles = ( // classDefs defined in the diagram text if (classDefs && Object.keys(classDefs).length > 0) { - if (graphType === 'flowchart' || graphType === 'flowchart-v2' || graphType === 'graph') { - const htmlLabels = config.htmlLabels || config.flowchart?.htmlLabels; + if (CLASSDEF_DIAGRAMS.includes(graphType)) { + const htmlLabels = config.htmlLabels || config.flowchart?.htmlLabels; // TODO why specifically check the Flowchart diagram config? const cssHtmlElements = ['> *', 'span']; // TODO make a constant const cssShapeElements = ['rect', 'polygon', 'ellipse', 'circle']; // TODO make a constant