Skip to content

Conversation

@omkarht
Copy link
Contributor

@omkarht omkarht commented Nov 28, 2025

📑 Summary

This PR fixes the issue where newlines were not being rendered in flowchart nodes containing KaTeX math equations. The fix ensures that markdown processing (which converts \n to <br/> tags) is applied to text with KaTeX, allowing newlines to work correctly in both plain text and markdown-formatted nodes with math equations.

Resolves #7194

📏 Design Decisions

Describe the way your implementation works or what design decisions you made if applicable.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2025

🦋 Changeset detected

Latest commit: a2698a7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Patch

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

@netlify
Copy link

netlify bot commented Nov 28, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit a2698a7
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/6929a3619b9e200008f38bb3
😎 Deploy Preview https://deploy-preview-7202--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added Type: Bug / Error Something isn't working or is incorrect Sponsored by MermaidChart labels Nov 28, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 28, 2025

Open in StackBlitz

@mermaid-js/examples

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/examples@7202

mermaid

npm i https://pkg.pr.new/mermaid-js/mermaid@7202

@mermaid-js/layout-elk

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@7202

@mermaid-js/layout-tidy-tree

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-tidy-tree@7202

@mermaid-js/mermaid-zenuml

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@7202

@mermaid-js/parser

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@7202

@mermaid-js/tiny

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/tiny@7202

commit: a2698a7

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 3.56%. Comparing base (614129c) to head (a2698a7).

Files with missing lines Patch % Lines
packages/mermaid/src/rendering-util/createText.ts 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #7202      +/-   ##
==========================================
- Coverage     3.56%   3.56%   -0.01%     
==========================================
  Files          473     473              
  Lines        47566   47568       +2     
  Branches       734     734              
==========================================
  Hits          1696    1696              
- Misses       45870   45872       +2     
Flag Coverage Δ
unit 3.56% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/mermaid/src/rendering-util/createText.ts 0.45% <0.00%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@argos-ci
Copy link

argos-ci bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 1 changed, 5 added Nov 28, 2025, 1:38 PM

@omkarht omkarht marked this pull request as ready for review November 28, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Sponsored by MermaidChart Type: Bug / Error Something isn't working or is incorrect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Impossible to add newlines to flowchart nodes with maths in them

2 participants