package sanitize import ( "strings" "testing" ) func TestSanitizeHTML_MJMLNewsletter(t *testing.T) { // Real MJML pattern from Pennylane newsletter in := `
Pennylane logo
5 notifications non lues
Bonjour Eliott,
Vous avez 5 notifications non lues
` out := SanitizeHTML(in) checks := []string{ "Pennylane logo", "5 notifications non lues", "Bonjour Eliott", "Vous avez 5 notifications", } for _, want := range checks { if !strings.Contains(out, want) { t.Errorf("MJML content %q missing from output.\nOutput: %s", want, out) } } if strings.TrimSpace(out) == "" { t.Fatal("sanitizer produced empty output for MJML newsletter") } }