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
- 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
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.
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
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
Code Sample
Setup
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.