@ossy/email 1.5.3 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.5.4 (2026-05-31)
7
+
8
+ **Note:** Version bump only for package @ossy/email
9
+
10
+
11
+
12
+
13
+
6
14
  ## 1.5.3 (2026-05-31)
7
15
 
8
16
  **Note:** Version bump only for package @ossy/email
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/email",
3
3
  "private": false,
4
- "version": "1.5.3",
4
+ "version": "1.5.4",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "module": "./src/index.js",
@@ -19,5 +19,5 @@
19
19
  "react": "*",
20
20
  "react-dom": "*"
21
21
  },
22
- "gitHead": "501d2273560cb04d668afd32edf448019f3312aa"
22
+ "gitHead": "188d15e1d90f102bc31996da3b32a5aef213f4b7"
23
23
  }
@@ -1,10 +1,22 @@
1
1
  import { renderToStaticMarkup } from 'react-dom/server'
2
2
  import React from 'react'
3
3
 
4
+ /** Preserve link targets when stripping tags so local stdout logs include magic-link URLs. */
5
+ function htmlToPlainText(html) {
6
+ const withLinks = html.replace(
7
+ /<a\b[^>]*\bhref=["']([^"']+)["'][^>]*>([\s\S]*?)<\/a>/gi,
8
+ (_, href, inner) => {
9
+ const label = inner.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim()
10
+ return label ? `${label}: ${href}` : href
11
+ },
12
+ )
13
+ return withLinks.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim()
14
+ }
15
+
4
16
  export const EmailRenderer = {
5
17
  render(Component, props) {
6
18
  const html = renderToStaticMarkup(React.createElement(Component, props))
7
- const text = html.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim()
19
+ const text = htmlToPlainText(html)
8
20
  return { html, text }
9
21
  }
10
22
  }