feat: email as mailto link + chat response rules tests (21 assertions)

- Email txeo.msx@gmail.com rendered as clickable mailto: link in chat
- New test: 86-chat-response-rules.test.mjs covering:
  contact (email shown, no contact form), phone (private),
  location (Lanzarote), language matching (EN/ES),
  off-topic redirect, tech search, no hallucination, years
- Tests are non-deterministic (live LLM) — may need re-runs
This commit is contained in:
juanatsap
2026-04-10 00:01:49 +01:00
parent 562552add8
commit aae818fbc0
2 changed files with 164 additions and 0 deletions
+4
View File
@@ -319,6 +319,10 @@ func (h *Handler) formatResponse(text string) string {
text = strings.Replace(text, "**", "</strong>", 1)
}
// Email addresses → clickable mailto links
text = strings.ReplaceAll(text, "txeo.msx@gmail.com",
`<a href="mailto:txeo.msx@gmail.com" class="chat-nav-link">txeo.msx@gmail.com</a>`)
// Links: [text](#anchor) → icon + nav link, [text](https://...) → external link
text = mdLinkRe.ReplaceAllStringFunc(text, func(match string) string {
parts := mdLinkRe.FindStringSubmatch(match)