Skip to content

Commit 8630657

Browse files
authored
Fix rendering of comments of GitLab merge requests (#937)
* Fix rendering of comments of GitLab merge requests Signed-off-by: Kévin Commaille <[email protected]> * Add changelog Signed-off-by: Kévin Commaille <[email protected]> * Change variable name to appease linter Signed-off-by: Kévin Commaille <[email protected]> --------- Signed-off-by: Kévin Commaille <[email protected]>
1 parent 7573d37 commit 8630657

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

changelog.d/937.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix rendering of comments of GitLab merge requests.

src/Connections/GitlabRepo.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,14 +785,18 @@ ${data.description}`;
785785
const target = relation ? '' : ` MR [${orgRepoName}!${mergeRequest.iid}](${mergeRequest.url}): "${mergeRequest.title}"`;
786786
let content = `**${result.author}** ${action}${target} ${comments}`;
787787

788+
let formatted = '';
788789
if (result.commentNotes) {
789790
content += "\n\n> " + result.commentNotes.join("\n\n> ");
791+
formatted = md.render(content);
792+
} else {
793+
formatted = md.renderInline(content);
790794
}
791795

792796
const eventPromise = this.intent.sendEvent(this.roomId, {
793797
msgtype: "m.notice",
794798
body: content,
795-
formatted_body: md.renderInline(content),
799+
formatted_body: formatted,
796800
format: "org.matrix.custom.html",
797801
...relation,
798802
}).catch(ex => {

0 commit comments

Comments
 (0)