You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 2, 2025. It is now read-only.
Remove extra <!-- end list --> generated by comrak (#850)
In some cases, `comrak` will automatically insert an XML
`<!-- end list -->` comment after a list item. We manually remove this
when converting a `comrak` tree back to a string.
// `comrak` will not recognize footnote definitions unless they have been referenced at least
@@ -1107,4 +1109,152 @@ Foo *bar* `[^summary]: allow this, it is in code quotes` quux.";
1107
1109
assert_eq!(expected, body);
1108
1110
assert_eq!("Baz fred **thud** corge.", conclusion.unwrap());
1109
1111
}
1112
+
1113
+
#[test]
1114
+
fntest_decode_erroneous_endlist(){
1115
+
let input = r#"The code in [`cmd/worker/slack.go`](cmd/worker/slack.go#L1-L42) is a Go program that sends a message to a Slack channel using a webhook URL.
1116
+
1117
+
Here's a breakdown of the code:
1118
+
1119
+
- Lines 1-8: The package declaration and import statements. The program imports packages for handling bytes, formatting, HTTP requests, and environment variables.
1120
+
1121
+
<QuotedCode>
1122
+
<Code>
1123
+
package main
1124
+
1125
+
import (
1126
+
"bytes"
1127
+
"fmt"
1128
+
"net/http"
1129
+
"os"
1130
+
)
1131
+
</Code>
1132
+
<Language>Go</Language>
1133
+
<Path>cmd/worker/slack.go</Path>
1134
+
<StartLine>1</StartLine>
1135
+
<EndLine>8</EndLine>
1136
+
</QuotedCode>
1137
+
1138
+
- Lines 10-12: A constant `SLACK_WEBHOOK_URL` is declared. This constant is used to get the Slack webhook URL from the environment variables.
1139
+
1140
+
<QuotedCode>
1141
+
<Code>
1142
+
const (
1143
+
SLACK_WEBHOOK_URL = "SLACK_WEBHOOK_URL"
1144
+
)
1145
+
</Code>
1146
+
<Language>Go</Language>
1147
+
<Path>cmd/worker/slack.go</Path>
1148
+
<StartLine>10</StartLine>
1149
+
<EndLine>12</EndLine>
1150
+
</QuotedCode>
1151
+
1152
+
- Lines 14-41: The `sendSlackMessage` function is defined. This function takes an organization name as an argument and sends a message to a Slack channel.
1153
+
1154
+
<QuotedCode>
1155
+
<Code>
1156
+
func sendSlackMessage(org string) error {
1157
+
1158
+
endpoint := os.Getenv(SLACK_WEBHOOK_URL)
1159
+
if endpoint == "" {
1160
+
return fmt.Errorf("sendSlackMessage: environment variables %s must not be empty",
return fmt.Errorf("sendSlackMessage: failed to send Slack message: %v", err)
1180
+
}
1181
+
defer resp.Body.Close()
1182
+
1183
+
return nil
1184
+
}
1185
+
</Code>
1186
+
<Language>Go</Language>
1187
+
<Path>cmd/worker/slack.go</Path>
1188
+
<StartLine>14</StartLine>
1189
+
<EndLine>41</EndLine>
1190
+
</QuotedCode>
1191
+
1192
+
[^summary]: The code in `cmd/worker/slack.go` is a Go program that sends a message to a Slack channel using a webhook URL. The `sendSlackMessage` function constructs a message about a new organization, creates an HTTP POST request with this message, and sends it to the Slack webhook URL."#;
1193
+
1194
+
let expected_body = r#"The code in [`cmd/worker/slack.go`](cmd/worker/slack.go#L1-L42) is a Go program that sends a message to a Slack channel using a webhook URL.
1195
+
1196
+
Here's a breakdown of the code:
1197
+
1198
+
- Lines 1-8: The package declaration and import statements. The program imports packages for handling bytes, formatting, HTTP requests, and environment variables.
- Lines 14-41: The `sendSlackMessage` function is defined. This function takes an organization name as an argument and sends a message to a Slack channel.
return fmt.Errorf("sendSlackMessage: failed to send Slack message: %v", err)
1246
+
}
1247
+
defer resp.Body.Close()
1248
+
1249
+
return nil
1250
+
}
1251
+
```"#;
1252
+
1253
+
let expected_conclusion = r#"The code in `cmd/worker/slack.go` is a Go program that sends a message to a Slack channel using a webhook URL. The `sendSlackMessage` function constructs a message about a new organization, creates an HTTP POST request with this message, and sends it to the Slack webhook URL."#;
0 commit comments