Skip to content

Conversation

@zishan9450
Copy link

🐛 Description

Fixes inconsistent HTML entity handling where titles containing # characters were truncated in some diagram types but not others.

Issue: Titles like "Book #2: sous-titre" worked in flowcharts but were truncated to "Book" in journey and sequence diagrams.

🔍 Root Cause

Jison lexer rules in multiple parsers excluded # characters from title parsing patterns using [^#\n;]+, causing text after # to be treated as comments and ignored.

✅ Solution

  • Removed # from exclusion patterns in title, acc_title, and acc_descr lexer rules
  • Applied fix consistently across all affected diagram parsers
  • Added comprehensive test suite to validate the fix and prevent regression

Changed Pattern Examples:

- <acc_title>(?!\n|;|#)*[^\n]*     
+ <acc_title>(?!\n|;)*[^\n]*       

- "title"\s[^#\n;]+                
+ "title"\s[^\n;]+                 

- Remove '#' from exclusion patterns in title and accessibility lexer rules
- Affects multiple diagram parsers: journey, sequence, c4, gantt, requirement, etc.
- Titles like 'Book mermaid-js#2: sous-titre' now parse correctly across all diagram types
- Add comprehensive test suite to validate the fix

Fixes mermaid-js#7105
@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

⚠️ No Changeset found

Latest commit: 91baaa2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Oct 27, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 91baaa2
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/68ffb2fe5b586300086e6ce5
😎 Deploy Preview https://deploy-preview-7110--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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 27, 2025

Open in StackBlitz

@mermaid-js/examples

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

mermaid

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

@mermaid-js/layout-elk

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

@mermaid-js/layout-tidy-tree

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

@mermaid-js/mermaid-zenuml

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

@mermaid-js/parser

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

@mermaid-js/tiny

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

commit: 91baaa2

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.55%. Comparing base (fed8a52) to head (91baaa2).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #7110      +/-   ##
==========================================
- Coverage     3.55%   3.55%   -0.01%     
==========================================
  Files          473     474       +1     
  Lines        47480   47491      +11     
  Branches       730     730              
==========================================
  Hits          1687    1687              
- Misses       45793   45804      +11     
Flag Coverage Δ
unit 3.55% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 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 Oct 27, 2025

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 27, 2025, 6:10 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant