fix: remove redundant Mermaid graph direction enforcement (#19024)

This commit is contained in:
Hao Cheng
2025-04-29 09:10:38 +02:00
committed by GitHub
parent 8266815cda
commit 2a3cc43b62

View File

@@ -22,10 +22,6 @@ export function preprocessMermaidCode(code: string): string {
.replace(/section\s+([^:]+):/g, (match, sectionName) => `section ${sectionName}`)
// Fix common syntax issues
.replace(/fifopacket/g, 'rect')
// Ensure graph has direction
.replace(/^graph\s+((?:TB|BT|RL|LR)*)/, (match, direction) => {
return direction ? match : 'graph TD'
})
// Clean up empty lines and extra spaces
.trim()
}