Skip to content

Multiline section titles (<br> / <br />) render inconsistently in Gantt chart #7602

@EmnaBarbouch

Description

@EmnaBarbouch

Description

When using HTML line breaks (
or
) inside Gantt section titles, rendering is inconsistent. In some cases, the text is not properly split into multiple lines, causing layout issues such as overflow, misalignment, or literal tag rendering.

Steps to reproduce

  1. Create a Mermaid Gantt chart with HTML line breaks in section titles:
    gantt
    title GANTT diagram with multiline section titles
    dateFormat YYYY-MM-DD

section A section
multiline
Task 1 : 2014-01-01, 2d

section Critical tasks
multiline
Task 2 : 2014-01-03, 2d
2. Render the chart
3. Open http://localhost:9000/gantt.html
4. Observe the section titles in the rendered diagram

Screenshots

Image

Code Sample

gantt
  title GANTT diagram with multiline section titles
  dateFormat YYYY-MM-DD

  section A section<br>multiline
  Task 1 : 2014-01-01, 2d

  section Critical tasks<br />multiline
  Task 2 : 2014-01-03, 2d

Setup

  • Mermaid version: 11.13.0
  • Browser and Version: Chrome

Suggested Solutions

Normalize parsing of
and

Convert to SVG with proper dy spacing

Additional Context

Breaks readability for complex Gantt charts with descriptive section titles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions