package web
import "testing"
func TestUnmarkTitle(t *testing.T) {
for in, want := range map[string]string{
"a disabled *Accept and land* rendered": "a disabled Accept and land rendered",
"the **whole** thing": "the whole thing",
// Underscores are left alone on purpose: emphasis and an
// identifier are the same characters, and mangling every path
// in a title is the worse trade.
"an _emphasised_ word": "an _emphasised_ word",
"a `code` span": "a code span",
// Left alone: not emphasis.
"2 * 3 = 6": "2 * 3 = 6",
"src/my_file_name.go": "src/my_file_name.go",
"unpaired *marker here": "unpaired *marker here",
} {
if got := unmarkTitle(in); got != want {
t.Errorf("unmarkTitle(%q)\n got %q\n want %q", in, got, want)
}
}
}