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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user