Skip to content

Commit

Permalink
Revert "utils.js: help mermaid js"
Browse files Browse the repository at this point in the history
This reverts commit 01318da.
  • Loading branch information
thypon committed Nov 28, 2024
1 parent 4a5ffaf commit 48b793d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,10 @@ export async function explainPatchHelper (patchBody, owner, repo, models, debug,

response = response.replaceAll('### Changes', '<details>\n<summary><i>Changes</i></summary>\n\n### Changes')

let firstDiagram = diagrams.shift()
if (!firstDiagram) {
firstDiagram = ''
}

if (re.test(response)) {
response = response.replaceAll(/(### Changes[\s\S]*?\n)###\s/g, `$1\n\n${diagrams.join('\n')}\n\n</details>\n\n${firstDiagram}\n\n### `)
response = response.replaceAll(/(### Changes[\s\S]*?\n)###\s/g, `$1${diagrams.join('\n')}\n</details>\n\n### `)
} else {
response += `\n\n${diagrams.join('\n')}\n\n</details>\n\n${firstDiagram}\n\n`
response += `${diagrams.join('\n')}\n</details>`
}

response = response.replaceAll('### C4 Diagram', '')
Expand Down

0 comments on commit 48b793d

Please sign in to comment.