Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line title in all mermaid diagrams #6324

Open
alex-papaioannou opened this issue Feb 24, 2025 · 0 comments
Open

Multi-line title in all mermaid diagrams #6324

alex-papaioannou opened this issue Feb 24, 2025 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@alex-papaioannou
Copy link

alex-papaioannou commented Feb 24, 2025

Hello everyone, I hope you are doing well. Do you think it would be possible to enable multi-line titles in all diagrams using the <br> tag?

Summary:

  • Enable the use of <br> within Mermaid titles to allow multiline text. This provides a straightforward, backward-compatible way to improve readability for longer or multiple-part titles.

Rationale:

  • Clarity: Diagrams often need detailed or multi-part titles (e.g., title and subtitle).
  • Consistency: Many Markdown/HTML tools already interpret <br> for line breaks.
  • Simplicity: Minimal changes—only parse <br> as a line break within the existing title syntax.

Proposed Implementation:

  • Extend the parsing of the title keyword to detect <br> tags and render them as newlines.
  • Continue to treat titles without <br> tags as single-line.
  • Maintain backward compatibility—no breaking changes.

Example

---
title: An Example Flowchart Title <br> With a Subtitle
---
flowchart LR
    A[Start] --> B{Decision?}
    B -->|Yes| C[Continue]
    B -->|No| D[Stop]
Loading

Screenshots

Image

@alex-papaioannou alex-papaioannou added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Feb 24, 2025
@alex-papaioannou alex-papaioannou changed the title multiline title in all mermaid diagrams Multi-line title in all mermaid diagrams Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant