Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
package dingtalk
import "testing"
func TestSealedInputQuotePreservesSourceSyntax(t *testing.T) {
const path = "/api/attachments/01a08f95-e516-7c96-8164-5856dbee3a47/download"
const img = ""
for _, tc := range []struct{ name, input, want string }{
{"empty", "", ""},
{"plain text", "hello **world**", "hello **world**"},
{"inline image", "前" + img + "后", "前[Image]后"},
{"quoted image", "> old\n> " + img + "\n\ncurrent", "> old\n> [Image]\n\ncurrent"},
{"inline code", "`" + img + "` " + img, "`" + img + "` [Image]"},
{"fenced code", "```md\n" + img + "\n```\n\n" + img, "```md\n" + img + "\n```\n\n[Image]"},
{"indented code", " " + img + "\n\n" + img, " " + img + "\n\n[Image]"},
{"escaped image", `\` + img + " " + img, `\` + img + " [Image]"},
{"ordinary link", "[download](" + path + ")", "[download](" + path + ")"},
{"external image", "", ""},
{"invalid attachment", "", ""},
{"different route", "", ""},
{"authored alt", "", ""},
{"authored title", "`, "`},
{"reference image", "![][ref]\n\n[ref]: " + path, "![][ref]\n\n[ref]: " + path},
{"HTML code", "<pre>\n" + img + "\n</pre>\n\n" + img, "<pre>\n" + img + "\n</pre>\n\n[Image]"},
{"image inside link", "[" + img + "](https://example.test)", "[[Image]](https://example.test)"},
} {
t.Run(tc.name, func(t *testing.T) {
if got := sealedInputQuote(tc.input); got != tc.want {
t.Fatalf("quote = %q, want %q", got, tc.want)
}
})
}
}