@travetto/email-compiler 3.3.1 → 3.3.2
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/package.json +1 -1
- package/src/util.ts +3 -3
package/package.json
CHANGED
package/src/util.ts
CHANGED
|
@@ -20,8 +20,8 @@ type Tokenized = {
|
|
|
20
20
|
*/
|
|
21
21
|
export class EmailCompileUtil {
|
|
22
22
|
static #HTML_CSS_IMAGE_URLS = [
|
|
23
|
-
/(?<pre><img[^>]src=\s*["'])(?<src>[^"]+)/g,
|
|
24
|
-
/(?<pre>background(?:-image)?:\s*url[(]['"]?)(?<src>[^"')]+)/g
|
|
23
|
+
/(?<pre><img[^>]src=\s*["'])(?<src>[^"{}]+)/g,
|
|
24
|
+
/(?<pre>background(?:-image)?:\s*url[(]['"]?)(?<src>[^"'){}]+)/g
|
|
25
25
|
];
|
|
26
26
|
|
|
27
27
|
static #EXT = /[.]email[.]tsx$/;
|
|
@@ -148,7 +148,7 @@ export class EmailCompileUtil {
|
|
|
148
148
|
|
|
149
149
|
const imageMap = new Map(await Promise.all(pendingImages.map(async ([token, ext, stream]) => {
|
|
150
150
|
const data = await StreamUtil.streamToBuffer(await stream);
|
|
151
|
-
return [token, `data:image/${ext};base64,${data.toString('base64')}`] as const;
|
|
151
|
+
return [token, `data:image/${ext.replace('.', '')};base64,${data.toString('base64')}`] as const;
|
|
152
152
|
})));
|
|
153
153
|
|
|
154
154
|
return finalize(token => imageMap.get(token)!);
|