fix: trim the direction string in flowchart

This commit is contained in:
Krishna Upadhyay
2025-07-10 21:39:19 -05:00
parent fad6676d18
commit e9ce8cf4da
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
fix: Update flowchart direction TD's behavior to be the same as TB

View File

@@ -403,7 +403,8 @@ You have to call mermaid.initialize.`
*
*/
public setDirection(dir: string) {
this.direction = dir;
this.direction = dir.trim();
if (/.*</.exec(this.direction)) {
this.direction = 'RL';
}