@@ -25,6 +25,7 @@ let empty_attachments =
25
25
26
26
let mrkdwn_of_markdown str = String. strip @@ Mrkdwn. mrkdwn_of_markdown str
27
27
let mrkdwn_of_markdown_opt = Option. map ~f: mrkdwn_of_markdown
28
+ let escape = Mrkdwn. escape_mrkdwn
28
29
29
30
let show_labels = function
30
31
| [] -> None
@@ -49,7 +50,7 @@ let generate_pull_request_notification notification channel =
49
50
)
50
51
in
51
52
let summary =
52
- sprintf " <%s|[%s]> Pull request #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url title
53
+ sprintf " <%s|[%s]> Pull request #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url (escape title)
53
54
action sender.login
54
55
in
55
56
{
@@ -88,7 +89,7 @@ let generate_pr_review_notification notification channel =
88
89
in
89
90
let summary =
90
91
sprintf " <%s|[%s]> *%s* <%s|%s> #%d <%s|%s>" repository.url repository.full_name sender.login review.html_url
91
- action_str number html_url title
92
+ action_str number html_url (escape title)
92
93
in
93
94
{
94
95
channel;
@@ -120,7 +121,7 @@ let generate_pr_review_comment_notification notification channel =
120
121
in
121
122
let summary =
122
123
sprintf " <%s|[%s]> *%s* %s on #%d <%s|%s>" repository.url repository.full_name sender.login action_str number
123
- html_url title
124
+ html_url (escape title)
124
125
in
125
126
let file =
126
127
match comment.path with
@@ -160,7 +161,7 @@ let generate_issue_notification notification channel =
160
161
)
161
162
in
162
163
let summary =
163
- sprintf " <%s|[%s]> Issue #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url title action
164
+ sprintf " <%s|[%s]> Issue #%d <%s|%s> %s by *%s*" repository.url repository.full_name number html_url (escape title) action
164
165
sender.login
165
166
in
166
167
{
@@ -194,7 +195,7 @@ let generate_issue_comment_notification notification channel =
194
195
in
195
196
let summary =
196
197
sprintf " <%s|[%s]> *%s* <%s|%s> on #%d <%s|%s>" repository.url repository.full_name sender.login comment.html_url
197
- action_str number issue.html_url title
198
+ action_str number issue.html_url (escape title)
198
199
in
199
200
{
200
201
channel;
@@ -342,7 +343,7 @@ let generate_commit_comment_notification api_commit notification channel =
342
343
in
343
344
let summary =
344
345
sprintf " <%s|[%s]> *%s* commented on `<%s|%s>` %s" repository.url repository.full_name sender.login comment.html_url
345
- (git_short_sha_hash commit_id) (first_line commit.message)
346
+ (git_short_sha_hash commit_id) (first_line (escape commit.message) )
346
347
in
347
348
let path =
348
349
match comment.path with
0 commit comments