Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1672edb
fix: deprecate flowchart.htmlLabels
darshanr0107 Sep 25, 2025
0c659d4
fix: add tests for deprecated flowchart.htmlLabels config option , u…
darshanr0107 Sep 25, 2025
8f8c5c8
chore: remove default value of flowchart.htmlLabels from schema
darshanr0107 Sep 25, 2025
3b5bbb0
fix: requirement diagram edge labels
darshanr0107 Sep 25, 2025
e82e464
chore: add changeset
darshanr0107 Sep 25, 2025
d6b0821
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
darshanr0107 Dec 22, 2025
e5f9f83
fix: update getEffectiveHtmlLabels to handle deprecated flowchart.htm…
darshanr0107 Jan 5, 2026
e2084ff
test: add unit tests for getEffectiveHtmlLabels to validate htmlLabel…
darshanr0107 Jan 5, 2026
baaa379
fix: integrate config API in mermaidAPI tests to ensure proper cssSty…
darshanr0107 Jan 5, 2026
df4ce8f
fix: update getEffectiveHtmlLabels to evaluate htmlLabels configuration
darshanr0107 Jan 5, 2026
2ed97ba
fix: lint issues
darshanr0107 Jan 5, 2026
75e245a
revert: requirementDb changes
darshanr0107 Jan 5, 2026
66de3ad
revert: Requirement diagram specific changes
darshanr0107 Jan 6, 2026
eca94b1
fix: evaluate node.useHtmlLabels before config lookup
darshanr0107 Jan 7, 2026
904061e
test: add case for root htmlLabels overriding flowchart htmlLabels
darshanr0107 Jan 7, 2026
a2fffff
Merge branch 'develop' into deprecate-flowchart.htmlLabels
darshanr0107 Jan 7, 2026
949c8f2
Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …
darshanr0107 Jan 7, 2026
08852f5
Merge branch 'deprecate-flowchart.htmlLabels' of https://github.com/m…
darshanr0107 Jan 7, 2026
276ceaa
fix: handle null case for htmlLabels and update schema to allow null …
darshanr0107 Jan 7, 2026
dea7f00
fix: ensure proper handling of bbox for text elements and refine HTML…
darshanr0107 Jan 7, 2026
f07adeb
fix: update htmlLabels description to clarify deprecation of diagram-…
darshanr0107 Jan 7, 2026
e78973a
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 7, 2026
6d45c14
docs: mark flowchart.htmlLabels as deprecated
darshanr0107 Jan 7, 2026
19cd1ed
Merge branch 'deprecate-flowchart.htmlLabels' of https://github.com/m…
darshanr0107 Jan 7, 2026
ca107a5
refactor: update htmlLabels handling and remove deprecated settings
darshanr0107 Jan 8, 2026
8883c63
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 8, 2026
1ff0063
chore:update docs
darshanr0107 Jan 8, 2026
3a7dc35
Merge branch 'deprecate-flowchart.htmlLabels' of https://github.com/m…
darshanr0107 Jan 8, 2026
1249c14
refactor: remove deprecated saveConfigFromInitialize calls in tests
darshanr0107 Jan 8, 2026
ac73461
refactor: move evaluate function export to config.ts
darshanr0107 Jan 8, 2026
742f9b0
refactor: streamline useHtmlLabels assignment across shapes
darshanr0107 Jan 8, 2026
2180ebc
chore: organize imports
darshanr0107 Jan 8, 2026
2450a2f
chore: update docs and changeset
darshanr0107 Jan 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eight-crabs-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': patch
---

fix: Support the [`htmlLabels` Mermaid config value](https://mermaid.js.org/config/schema-docs/config.html#htmllabels) whenever possible
5 changes: 5 additions & 0 deletions .changeset/seven-towns-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'mermaid': minor
---

feat: Deprecate [`flowchart.htmlLabels`](https://mermaid.js.org/config/schema-docs/config-defs-flowchart-diagram-config.html#htmllabels) in favor of [root-level `htmlLabels`](https://mermaid.js.org/config/schema-docs/config.html#htmllabels) in Mermaid config
11 changes: 8 additions & 3 deletions docs/config/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ The following code snippet shows the structure of a directive:
"theme": "dark",
"fontFamily": "monospace",
"logLevel": "info",
"htmlLabels": true,
"flowchart": {
"htmlLabels": true,
"curve": "linear"
},
"sequence": {
Expand Down Expand Up @@ -236,7 +236,7 @@ A --> C[End]

Some common flowchart configurations are:

- _htmlLabels_: true/false
- ~~_htmlLabels_~~: Deprecated, [prefer setting this at the root level](/config/schema-docs/config#htmllabels).
- _curve_: linear/curve
- _diagramPadding_: number
- _useMaxWidth_: number
Expand All @@ -246,10 +246,15 @@ _Soon we plan to publish a complete list of all diagram-specific configurations

The following code snippet changes flowchart config:

`%%{init: { "flowchart": { "htmlLabels": true, "curve": "linear" } } }%%`
```
%%{init: { "htmlLabels": true, "flowchart": { "curve": "linear" } } }%%
```

Here we are overriding only the flowchart config, and not the general config, setting `htmlLabels` to `true` and `curve` to `linear`.

> **Warning**
> **Deprecated:** `flowchart.htmlLabels` has been deprecated from (v\<MERMAID_RELEASE_VERSION>+). Use the global `htmlLabels` configuration instead. For example, instead of `"flowchart": { "htmlLabels": true }`, use `"htmlLabels": true` at the top level.

```mermaid-example
%%{init: { "flowchart": { "htmlLabels": true, "curve": "linear" } } }%%
graph TD
Expand Down
2 changes: 2 additions & 0 deletions docs/config/setup/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
## Functions

- [addDirective](functions/addDirective.md)
- [evaluate](functions/evaluate.md)
- [getConfig](functions/getConfig.md)
- [getEffectiveHtmlLabels](functions/getEffectiveHtmlLabels.md)
- [getSiteConfig](functions/getSiteConfig.md)
- [getUserDefinedConfig](functions/getUserDefinedConfig.md)
- [reset](functions/reset.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/addDirective.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **addDirective**(`directive`): `void`

Defined in: [packages/mermaid/src/config.ts:188](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L188)
Defined in: [packages/mermaid/src/config.ts:197](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L197)

Pushes in a directive to the configuration

Expand Down
31 changes: 31 additions & 0 deletions docs/config/setup/config/functions/evaluate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
> **Warning**
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/evaluate.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/evaluate.md).

[**mermaid**](../../README.md)

---

# Function: evaluate()

> **evaluate**(`val?`): `boolean`

Defined in: [packages/mermaid/src/config.ts:16](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L16)

Converts a string/boolean into a boolean

## Parameters

### val?

String or boolean to convert

`string` | `boolean`

## Returns

`boolean`

The result from the input
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/getConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **getConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

Defined in: [packages/mermaid/src/config.ts:131](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L131)
Defined in: [packages/mermaid/src/config.ts:140](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L140)

## getConfig

Expand Down
31 changes: 31 additions & 0 deletions docs/config/setup/config/functions/getEffectiveHtmlLabels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
> **Warning**
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/getEffectiveHtmlLabels.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/getEffectiveHtmlLabels.md).

[**mermaid**](../../README.md)

---

# Function: getEffectiveHtmlLabels()

> **getEffectiveHtmlLabels**(`config`): `boolean`

Defined in: [packages/mermaid/src/config.ts:282](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L282)

Helper function to handle deprecated flowchart.htmlLabels

## Parameters

### config

[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

The configuration object (merged config with defaults)

## Returns

`boolean`

The effective htmlLabels value based on precedence: root flowchart default
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/getSiteConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **getSiteConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

Defined in: [packages/mermaid/src/config.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L96)
Defined in: [packages/mermaid/src/config.ts:105](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L105)

## getSiteConfig

Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/getUserDefinedConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **getUserDefinedConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

Defined in: [packages/mermaid/src/config.ts:252](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L252)
Defined in: [packages/mermaid/src/config.ts:263](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L263)

## Returns

Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **reset**(`config`): `void`

Defined in: [packages/mermaid/src/config.ts:221](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L221)
Defined in: [packages/mermaid/src/config.ts:230](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L230)

## reset

Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/sanitize.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **sanitize**(`options`): `void`

Defined in: [packages/mermaid/src/config.ts:146](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L146)
Defined in: [packages/mermaid/src/config.ts:155](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L155)

## sanitize

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **saveConfigFromInitialize**(`conf`): `void`

Defined in: [packages/mermaid/src/config.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L75)
Defined in: [packages/mermaid/src/config.ts:84](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L84)

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/setConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **setConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

Defined in: [packages/mermaid/src/config.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L113)
Defined in: [packages/mermaid/src/config.ts:122](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L122)

## setConfig

Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/setSiteConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **setSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

Defined in: [packages/mermaid/src/config.ts:61](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L61)
Defined in: [packages/mermaid/src/config.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L70)

## setSiteConfig

Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/updateCurrentConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **updateCurrentConfig**(`siteCfg`, `_directives`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

Defined in: [packages/mermaid/src/config.ts:15](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L15)
Defined in: [packages/mermaid/src/config.ts:24](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L24)

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/config/setup/config/functions/updateSiteConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

> **updateSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)

Defined in: [packages/mermaid/src/config.ts:79](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L79)
Defined in: [packages/mermaid/src/config.ts:88](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L88)

## Parameters

Expand Down
Loading
Loading