From 48b793d1f69bde0717c83ac21538ae9ba6088edc Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Thu, 28 Nov 2024 10:03:23 -0800 Subject: [PATCH] Revert "utils.js: help mermaid js" This reverts commit 01318dad59d78f8dcef34f48ed2eaf8d733b153f. --- src/utils.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/utils.js b/src/utils.js index b959270..23e5b2c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -64,15 +64,10 @@ export async function explainPatchHelper (patchBody, owner, repo, models, debug, response = response.replaceAll('### Changes', '
\nChanges\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
\n\n${firstDiagram}\n\n### `) + response = response.replaceAll(/(### Changes[\s\S]*?\n)###\s/g, `$1${diagrams.join('\n')}\n\n\n### `) } else { - response += `\n\n${diagrams.join('\n')}\n\n\n\n${firstDiagram}\n\n` + response += `${diagrams.join('\n')}\n` } response = response.replaceAll('### C4 Diagram', '')