Skip to content

Commit bc417a9

Browse files
fix(preview-server): <svg> not being flagged by compatibility checker (#2259)
Co-authored-by: gabriel miranda <[email protected]>
1 parent 955bb7c commit bc417a9

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.changeset/afraid-sides-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-email/preview-server": patch
3+
---
4+
5+
fix `<svg>` not being flagged as incompatible

packages/preview-server/src/utils/caniemail/get-element-names.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ export const getElementNames = (title: string, keywords: string | null) => {
44
const [_full, elementName] = match;
55

66
if (elementName) {
7-
return [elementName];
7+
return [elementName.toLowerCase()];
88
}
99
}
1010

1111
if (keywords !== null && keywords.length > 0) {
12-
return keywords.split(/\s*,\s*/).map((piece) => piece.trim());
12+
return keywords
13+
.toLowerCase()
14+
.split(/\s*,\s*/)
15+
.map((piece) => piece.trim());
1316
}
1417

1518
if (title.split(',').length > 1) {
16-
return title.split(/\s*,\s*/).map((piece) => piece.trim());
19+
return title
20+
.toLowerCase()
21+
.split(/\s*,\s*/)
22+
.map((piece) => piece.trim());
1723
}
1824

1925
return [];

0 commit comments

Comments
 (0)