mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-30 01:55:17 +08:00
fix: remove redundant Mermaid graph direction enforcement (#19024)
This commit is contained in:
parent
8266815cda
commit
2a3cc43b62
@ -22,10 +22,6 @@ export function preprocessMermaidCode(code: string): string {
|
|||||||
.replace(/section\s+([^:]+):/g, (match, sectionName) => `section ${sectionName}:`)
|
.replace(/section\s+([^:]+):/g, (match, sectionName) => `section ${sectionName}:`)
|
||||||
// Fix common syntax issues
|
// Fix common syntax issues
|
||||||
.replace(/fifopacket/g, 'rect')
|
.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
|
// Clean up empty lines and extra spaces
|
||||||
.trim()
|
.trim()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user