mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00
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:
parent
7573d37527
commit
863065792e
1
changelog.d/937.bugfix
Normal file
1
changelog.d/937.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix rendering of comments of GitLab merge requests.
|
@ -785,14 +785,18 @@ ${data.description}`;
|
|||||||
const target = relation ? '' : ` MR [${orgRepoName}!${mergeRequest.iid}](${mergeRequest.url}): "${mergeRequest.title}"`;
|
const target = relation ? '' : ` MR [${orgRepoName}!${mergeRequest.iid}](${mergeRequest.url}): "${mergeRequest.title}"`;
|
||||||
let content = `**${result.author}** ${action}${target} ${comments}`;
|
let content = `**${result.author}** ${action}${target} ${comments}`;
|
||||||
|
|
||||||
|
let formatted = '';
|
||||||
if (result.commentNotes) {
|
if (result.commentNotes) {
|
||||||
content += "\n\n> " + result.commentNotes.join("\n\n> ");
|
content += "\n\n> " + result.commentNotes.join("\n\n> ");
|
||||||
|
formatted = md.render(content);
|
||||||
|
} else {
|
||||||
|
formatted = md.renderInline(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
const eventPromise = this.intent.sendEvent(this.roomId, {
|
const eventPromise = this.intent.sendEvent(this.roomId, {
|
||||||
msgtype: "m.notice",
|
msgtype: "m.notice",
|
||||||
body: content,
|
body: content,
|
||||||
formatted_body: md.renderInline(content),
|
formatted_body: formatted,
|
||||||
format: "org.matrix.custom.html",
|
format: "org.matrix.custom.html",
|
||||||
...relation,
|
...relation,
|
||||||
}).catch(ex => {
|
}).catch(ex => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user