Fix rendering of comments of GitLab merge requests (#937)

* Fix rendering of comments of GitLab merge requests

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Change variable name to appease linter

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-06-19 19:28:51 +02:00 committed by GitHub
parent 7573d37527
commit 863065792e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

1
changelog.d/937.bugfix Normal file
View File

@ -0,0 +1 @@
Fix rendering of comments of GitLab merge requests.

View File

@ -785,14 +785,18 @@ ${data.description}`;
const target = relation ? '' : ` MR [${orgRepoName}!${mergeRequest.iid}](${mergeRequest.url}): "${mergeRequest.title}"`;
let content = `**${result.author}** ${action}${target} ${comments}`;
let formatted = '';
if (result.commentNotes) {
content += "\n\n> " + result.commentNotes.join("\n\n> ");
formatted = md.render(content);
} else {
formatted = md.renderInline(content);
}
const eventPromise = this.intent.sendEvent(this.roomId, {
msgtype: "m.notice",
body: content,
formatted_body: md.renderInline(content),
formatted_body: formatted,
format: "org.matrix.custom.html",
...relation,
}).catch(ex => {