UBERF-9634 Handle unsupported markdown in github integration (port to develop) (#8260)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2025-03-18 19:20:24 +07:00
committed by GitHub
parent 31b54bb039
commit 6f63a407dd
21 changed files with 203 additions and 45 deletions
@@ -211,7 +211,11 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
update.title = event.pull_request.title
}
if (event.changes.body !== undefined) {
update.description = await this.provider.getMarkup(integration, event.pull_request.body, this.stripGuestLink)
update.description = await this.provider.getMarkupSafe(
integration,
event.pull_request.body,
this.stripGuestLink
)
du.markdown = await this.provider.getMarkdown(update.description)
}
if (event.changes.base !== undefined) {
@@ -464,7 +468,11 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
}
const pullRequestData: GithubPullRequestData = {
title: pullRequestExternal.title,
description: await this.provider.getMarkup(container.container, pullRequestExternal.body, this.stripGuestLink),
description: await this.provider.getMarkupSafe(
container.container,
pullRequestExternal.body,
this.stripGuestLink
),
assignee: assignees[0]?.person ?? null,
reviewers: reviewers.map((it: any) => it.person),
draft: pullRequestExternal.isDraft,
@@ -1067,7 +1075,7 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
},
{ url: issueExternal.url }
)
issueData.description = await this.provider.getMarkup(container.container, body, this.stripGuestLink)
issueData.description = await this.provider.getMarkupSafe(container.container, body, this.stripGuestLink)
} else if (hasFieldsUpdate) {
await this.ctx.withLog('==> updatePullRequest:', {}, async () => {
this.ctx.info('update-fields', {