From d571a3720ae42f3cf5fddf2454e04aa2ad775b0c Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 22 Jul 2025 09:43:46 +0300 Subject: clickeable emails --- src/components/widgets/Steps2.astro | 13 ++++++------- src/pages/polityka-prywatnosci.md | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/components/widgets/Steps2.astro b/src/components/widgets/Steps2.astro index b37fbc0..e13a377 100644 --- a/src/components/widgets/Steps2.astro +++ b/src/components/widgets/Steps2.astro @@ -19,12 +19,11 @@ const { bg = await Astro.slots.render('bg'), } = Astro.props; -// Function to detect and wrap email addresses in mailto links -function processEmailLinks(text: string): string { - const emailRegex = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g; - return text.replace(emailRegex, (email) => { - return `${email}`; - }); +// Function to make email addresses clickable +function makeEmailsClickable(text: string | undefined): string { + if (!text) return ''; + const emailRegex = /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g; + return text.replace(emailRegex, '$1'); } --- @@ -68,7 +67,7 @@ function processEmailLinks(text: string): string {

-

+

)) diff --git a/src/pages/polityka-prywatnosci.md b/src/pages/polityka-prywatnosci.md index 02f9828..3562b8d 100644 --- a/src/pages/polityka-prywatnosci.md +++ b/src/pages/polityka-prywatnosci.md @@ -50,6 +50,6 @@ Jeśli masz jakiekolwiek pytania dotyczące przetwarzania danych lub prywatnośc Jeśli masz pytania dotyczące tej Polityki Prywatności, możesz skontaktować się z nami: -- Email: grestech.biuro@gmail.com +- Email: [grestech.biuro@gmail.com](mailto:grestech.biuro@gmail.com) © Gres-Tech 2025. Wszystkie prawa zastrzeżone. -- cgit v1.2.3