Skip to content

Commit

Permalink
Fix markdown with svg
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Dec 30, 2024
1 parent 29f3fc3 commit 2e38b0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/common/gitProvider/azureDevops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,12 @@ _Powered by [sfdx-hardis](${CONSTANTS.DOC_URL_ROOT}) from job [${azureJobName}](
imageName // File name
);
if (attachment && attachment.url) {
uxLog(this, c.grey(`[Bitbucket Integration] Image uploaded for comment: ${attachment.url}`));
return attachment.url;
}
else {
uxLog(this, c.yellow(`[Bitbucket Integration] Image uploaded but unable to get URL from response\n${JSON.stringify(attachment, null, 2)}`));
}
} catch (e) {
uxLog(this, c.yellow(`[Azure Integration] Error while uploading image ${localImagePath}\n${(e as Error).message}`));
}
Expand Down
4 changes: 4 additions & 0 deletions src/common/gitProvider/bitbucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,12 @@ export class BitbucketProvider extends GitProviderRoot {
_body: filesForm,
});
if (attachmentResponse?.data?.links?.self?.href) {
uxLog(this, c.grey(`[Bitbucket Integration] Image uploaded for comment: ${attachmentResponse.data.links.self.href}`));
return attachmentResponse.data.links.self.href;
}
else {
uxLog(this, c.yellow(`[Bitbucket Integration] Image uploaded but unable to get URL from response\n${JSON.stringify(attachmentResponse, null, 2)}`));
}
} catch (e) {
uxLog(this, c.yellow(`[Bitbucket Integration] Error while uploading image ${localImagePath}\n${(e as Error).message}`));
}
Expand Down
3 changes: 2 additions & 1 deletion src/common/gitProvider/utilsMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ async function generateDiffMarkdownWithMermaid(fileMetadata: string | null, from

async function generateDiffMarkdownWithSvg(fileMetadata: string | null, fromCommit: string, toCommit: string, flowDiffMarkdownList: any, flowName: string) {
const { outputDiffMdFile } = await generateFlowVisualGitDiff(fileMetadata, fromCommit, toCommit, { mermaidMd: true, svgMd: true, debug: false });
flowDiffMarkdownList.push({ name: flowName, markdown: outputDiffMdFile });
const flowDiffMarkdownWithSvg = await fs.readFile(outputDiffMdFile, "utf8");
flowDiffMarkdownList.push({ name: flowName, markdown: flowDiffMarkdownWithSvg });
}

function getAiPromptResponseMarkdown(title, message) {
Expand Down

0 comments on commit 2e38b0d

Please sign in to comment.