From d3c8f691b5e5f6661eac47c785280ad7d3bcd554 Mon Sep 17 00:00:00 2001 From: zimk Date: Mon, 16 Mar 2026 19:29:58 +0800 Subject: [PATCH] fix: htmlToText preserve href links for activation email parsing --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 06cbc06..4e3c656 100644 --- a/src/index.js +++ b/src/index.js @@ -126,7 +126,8 @@ function htmlToText(html) { return html .replace(//gi, "") .replace(//gi, "") - .replace(//gi, "\n") + .replace(/]*href=["']([^"']+)["'][^>]*>/gi, (_, href) => href + " ") + .replace(/\s*/gi, "\n") .replace(/<\/p>/gi, "\n") .replace(/<[^>]+>/g, "") .replace(/ /gi, " ")