package api
import "testing"
// A digest quotes a chat line as prose: a link reads as its text, and
// so does an anchor a line bridged from fossil still carries.
func TestADigestQuotesLinksAsTheirWords(t *testing.T) {
for in, want := range map[string]string{
"see [6df13eaedc](https://f.example/r/x/info/6df13eaedc) now": "see 6df13eaedc now",
"(check-in: <a href='/r/libfossil/info/6df13eaedc'>6df13eaedc</a>, user: <a href='/r/libfossil/timeline?u=d&c=6df'>danshearer</a>)": "(check-in: 6df13eaedc, user: danshearer)",
`a [b\]c](u) d`: "a b]c d",
"plain *markdown* stays": "plain *markdown* stays",
} {
if got := chatPlain(in); got != want {
t.Errorf("FAIL: %q -> %q, want %q", in, got, want)
}
}
t.Log("ok")
}