Repository navigation
Deprecate flowchart-level htmlLabels config option - #6995
Conversation
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
🦋 Changeset detectedLatest commit: 2450a2f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
…date insertEdgeLabel to use new getEffectiveHtmlLabels helper on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #6995 +/- ##
==========================================
+ Coverage 3.57% 3.58% +0.01%
==========================================
Files 474 473 -1
Lines 47498 47506 +8
Branches 734 739 +5
==========================================
+ Hits 1696 1705 +9
+ Misses 45802 45801 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
…deprecate-flowchart.htmlLabels
…lLabels and adjust schema for htmlLabels type on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
…s behavior on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
…les retrieval on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
…specific settings on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
…ermaid-js/mermaid into deprecate-flowchart.htmlLabels
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
…ermaid-js/mermaid into deprecate-flowchart.htmlLabels
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
There was a problem hiding this comment.
I've got some non-blocking comments, which I think will be good to fix before merging.
@darshanr0107, can we add the following to the PR description:
Fixes #1431
I think this PR closes it.
And since this PR is a deprecation notice and a bug fix PR, can you add some more details + examples to the PR description?
I wonder if it's also worth doing a squash merge, since this PR has 32 commits when it probably doesn't actually need that many 😬
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
📑 Summary
This PR deprecates the
flowchart.htmlLabelsconfiguration option in favor of using the root-levelhtmlLabelssetting. This change fixes inconsistent behavior where both configuration options existed but had unclear precedence, which could lead to unexpected results in your diagrams.This PR also fixes class diagram, ER diagram, and requirement diagram edge labels rendering using HTML, even when the root level
htmlLabelswas set to false. They now no longer use<foreignObject>whenhtmlLabels: falseis set (see @argos-ci changes).FIxes #1431
What Changed and Why
The Problem
Previously, Mermaid supported two ways to configure HTML labels:
htmlLabels: trueflowchart.htmlLabels: trueWhen both were set, the behavior was inconsistent and confusing.
The Solution
Now, root-level
htmlLabelsis the single source of truth. The root-level setting:The old
flowchart.htmlLabelsoption still works for backward compatibility,but:
htmlLabelsis also set📖 What You Need to Know
For Most Users: No Action Required
If you're not using
flowchart.htmlLabelsin your configuration, you don't need to do anything. Your diagrams will continue to work exactly as before.If You're Using
flowchart.htmlLabels: Simple MigrationIf you currently have code like this:
Simply move it to the root level:
🔍 Examples
Before:
After:
Note:Fixed class diagram, ER diagram, and requirement diagram edge labels rendering using HTML, even when the root level htmlLabels was set to false.
📏 Design Decisions
getEffectiveHtmlLabels(config)to centralize logic.flowchart.htmlLabelslogs a deprecation warning.flowchart.htmlLabelsas deprecated in the schema.📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.