Skip to content

Commit 88372a9

Browse files
authored
fix(plugin-minify): turn off aggressive quote removal. fixes #216 (#218)
1 parent 6604d61 commit 88372a9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/jsx-email/test/render/.snapshots/render.test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,6 @@ exports[`render > renders the vercel demo template 2`] = `
787787
</html>"
788788
`;
789789
790-
exports[`render > renders with minifying 1`] = `"<!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional//EN\\" \\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\"><html dir=ltr lang=en xmlns:o=urn:schemas-microsoft-com:office:office xmlns:v=urn:schemas-microsoft-com:vml><meta charset=utf8><meta name=viewport content=width=device-width,initial-scale=1><meta name=x-apple-disable-message-reformatting><meta name=format-detection content=\\"telephone=no, date=no, address=no, email=no, url=no\\"><meta name=viewport content=width=device-width,initial-scale=1><meta name=x-apple-disable-message-reformatting><meta name=format-detection content=\\"telephone=no, date=no, address=no, email=no, url=no\\"><?[if mso]&#62<xml&#62<o:OfficeDocumentSettings&#62<o:AllowPNG&#62</o:AllowPNG&#62<o:PixelsPerInch&gt;96</o:PixelsPerInch&#62</o:OfficeDocumentSettings&#62</xml&#62<![endif]><body style=background-color:#fff;font-family:HelveticaNeue,Helvetica,Arial,sans-serif><div style=table-layout:fixed;width:100%><div style=\\"margin:0 auto;max-width:600px\\"><span><?[if mso]&#62<table align=\\"center\\" width=\\"600\\" style=\\"border-spacing: 0; width:600px;\\" role=\\"presentation\\"&#62<tr&#62<td&#62<![endif]></span><table align=center border=0 cellpadding=0 cellspacing=0 role=presentation style=\\"max-width:600px;background-color:#fff;border:1px solid #eee;border-radius:5px;box-shadow:0 5px 10px rgba(20,50,70,.2);margin-top:20px;width:360px;margin:0 auto;padding:68px 0 130px\\"width=100%><tr style=width:100%><td align=center><img alt=Plaid height=88 src=https://jsx.email/assets/demo/plaid-logo.png style=\\"border:none;display:block;outline:0;text-decoration:none;margin:0 auto\\"width=212><p style=\\"font-size:11px;line-height:16px;margin:16px 8px 8px 8px;color:#0a85ea;font-weight:700;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;height:16px;letter-spacing:0;text-transform:uppercase;text-align:center\\">Verify Your Identity<h1 style=color:#000;display:inline-block;font-family:HelveticaNeue-Medium,Helvetica,Arial,sans-serif;font-size:20px;font-weight:500;line-height:24px;margin-bottom:0;margin-top:0;text-align:center>Enter the following code to finish linking Venmo.</h1><table align=center border=0 cellpadding=0 cellspacing=0 role=presentation style=\\"background:rgba(0,0,0,.05);border-radius:4px;margin:16px auto 14px;vertical-align:middle;width:280px\\"width=100%><tr><td><p style=\\"font-size:32px;line-height:40px;margin:0 auto;color:#000;display:inline-block;font-family:HelveticaNeue-Bold;font-weight:700;letter-spacing:6px;padding-bottom:8px;padding-top:8px;width:100%;text-align:center\\"></table><p style=\\"font-size:15px;line-height:23px;margin:0;color:#444;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;letter-spacing:0;padding:0 40px;text-align:center\\">Not expecting this email?<p style=\\"font-size:15px;line-height:23px;margin:0;color:#444;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;letter-spacing:0;padding:0 40px;text-align:center\\">Contact <a href=mailto:[email protected] style=color:#444;text-decoration:underline>[email protected]</a> if you did not request this code.</table><span><?[if mso]&#62</td&#62</tr&#62</table&#62<![endif]></span></div></div><p style=font-size:12px;line-height:23px;margin:0;color:#000;font-weight:800;letter-spacing:0;margin-top:20px;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;text-align:center;text-transform:uppercase>Securely powered by Plaid."`;
790+
exports[`render > renders with minifying 1`] = `"<!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional//EN\\" \\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\"><html dir=\\"ltr\\"lang=\\"en\\"xmlns:o=\\"urn:schemas-microsoft-com:office:office\\"xmlns:v=\\"urn:schemas-microsoft-com:vml\\"><meta charset=\\"utf8\\"><meta name=\\"viewport\\"content=\\"width=device-width,initial-scale=1\\"><meta name=\\"x-apple-disable-message-reformatting\\"><meta name=\\"format-detection\\"content=\\"telephone=no, date=no, address=no, email=no, url=no\\"><meta name=\\"viewport\\"content=\\"width=device-width,initial-scale=1\\"><meta name=\\"x-apple-disable-message-reformatting\\"><meta name=\\"format-detection\\"content=\\"telephone=no, date=no, address=no, email=no, url=no\\"><?[if mso]&#62<xml&#62<o:OfficeDocumentSettings&#62<o:AllowPNG&#62</o:AllowPNG&#62<o:PixelsPerInch&gt;96</o:PixelsPerInch&#62</o:OfficeDocumentSettings&#62</xml&#62<![endif]><body style=\\"background-color:#fff;font-family:HelveticaNeue,Helvetica,Arial,sans-serif\\"><div style=\\"table-layout:fixed;width:100%\\"><div style=\\"margin:0 auto;max-width:600px\\"><span><?[if mso]&#62<table align=\\"center\\" width=\\"600\\" style=\\"border-spacing: 0; width:600px;\\" role=\\"presentation\\"&#62<tr&#62<td&#62<![endif]></span><table align=\\"center\\"border=\\"0\\"cellpadding=\\"0\\"cellspacing=\\"0\\"role=\\"presentation\\"style=\\"max-width:600px;background-color:#fff;border:1px solid #eee;border-radius:5px;box-shadow:0 5px 10px rgba(20,50,70,.2);margin-top:20px;width:360px;margin:0 auto;padding:68px 0 130px\\"width=\\"100%\\"><tr style=\\"width:100%\\"><td align=\\"center\\"><img alt=\\"Plaid\\"height=\\"88\\"src=\\"https://jsx.email/assets/demo/plaid-logo.png\\"style=\\"border:none;display:block;outline:0;text-decoration:none;margin:0 auto\\"width=\\"212\\"><p style=\\"font-size:11px;line-height:16px;margin:16px 8px 8px 8px;color:#0a85ea;font-weight:700;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;height:16px;letter-spacing:0;text-transform:uppercase;text-align:center\\">Verify Your Identity<h1 style=\\"color:#000;display:inline-block;font-family:HelveticaNeue-Medium,Helvetica,Arial,sans-serif;font-size:20px;font-weight:500;line-height:24px;margin-bottom:0;margin-top:0;text-align:center\\">Enter the following code to finish linking Venmo.</h1><table align=\\"center\\"border=\\"0\\"cellpadding=\\"0\\"cellspacing=\\"0\\"role=\\"presentation\\"style=\\"background:rgba(0,0,0,.05);border-radius:4px;margin:16px auto 14px;vertical-align:middle;width:280px\\"width=\\"100%\\"><tr><td><p style=\\"font-size:32px;line-height:40px;margin:0 auto;color:#000;display:inline-block;font-family:HelveticaNeue-Bold;font-weight:700;letter-spacing:6px;padding-bottom:8px;padding-top:8px;width:100%;text-align:center\\"></table><p style=\\"font-size:15px;line-height:23px;margin:0;color:#444;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;letter-spacing:0;padding:0 40px;text-align:center\\">Not expecting this email?<p style=\\"font-size:15px;line-height:23px;margin:0;color:#444;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;letter-spacing:0;padding:0 40px;text-align:center\\">Contact <a href=\\"mailto:[email protected]\\"style=\\"color:#444;text-decoration:underline\\">[email protected]</a> if you did not request this code.</table><span><?[if mso]&#62</td&#62</tr&#62</table&#62<![endif]></span></div></div><p style=\\"font-size:12px;line-height:23px;margin:0;color:#000;font-weight:800;letter-spacing:0;margin-top:20px;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;text-align:center;text-transform:uppercase\\">Securely powered by Plaid."`;
791791
792792
exports[`render > renders without minifying 1`] = `"<!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional//EN\\" \\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\"><html lang=\\"en\\" dir=\\"ltr\\" xmlns:o=\\"urn:schemas-microsoft-com:office:office\\" xmlns:v=\\"urn:schemas-microsoft-com:vml\\"><head><meta http-equiv=\\"Content-Type\\" content=\\"text/html; charset=UTF-8\\"><meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1, user-scalable=yes\\"><meta name=\\"x-apple-disable-message-reformatting\\"><meta name=\\"format-detection\\" content=\\"telephone=no, date=no, address=no, email=no, url=no\\"><meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1, user-scalable=yes\\"><meta name=\\"x-apple-disable-message-reformatting\\"><meta name=\\"format-detection\\" content=\\"telephone=no, date=no, address=no, email=no, url=no\\"><!--[if mso]><xml><o:OfficeDocumentSettings><o:AllowPNG></o:AllowPNG><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body style=\\"background-color:#ffffff;font-family:HelveticaNeue,Helvetica,Arial,sans-serif\\"><div style=\\"table-layout:fixed;width:100%\\"><div style=\\"margin:0 auto;max-width:600px\\"><span><!--[if mso]><table align=\\"center\\" width=\\"600\\" style=\\"border-spacing: 0; width:600px;\\" role=\\"presentation\\"><tr><td><![endif]--></span><table align=\\"center\\" width=\\"100%\\" role=\\"presentation\\" cellspacing=\\"0\\" cellpadding=\\"0\\" border=\\"0\\" style=\\"max-width:600px;background-color:#ffffff;border:1px solid #eee;border-radius:5px;box-shadow:0 5px 10px rgba(20,50,70,.2);margin-top:20px;width:360px;margin:0 auto;padding:68px 0 130px\\"><tbody><tr style=\\"width:100%\\"><td align=\\"center\\"><img alt=\\"Plaid\\" src=\\"https://jsx.email/assets/demo/plaid-logo.png\\" width=\\"212\\" height=\\"88\\" style=\\"border:none;display:block;outline:none;text-decoration:none;margin:0 auto\\"><p style=\\"font-size:11px;line-height:16px;margin:16px 8px 8px 8px;color:#0a85ea;font-weight:700;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;height:16px;letter-spacing:0;text-transform:uppercase;text-align:center\\">Verify Your Identity</p><h1 style=\\"color:#000;display:inline-block;font-family:HelveticaNeue-Medium,Helvetica,Arial,sans-serif;font-size:20px;font-weight:500;line-height:24px;margin-bottom:0;margin-top:0;text-align:center\\">Enter the following code to finish linking Venmo.</h1><table align=\\"center\\" width=\\"100%\\" style=\\"background:rgba(0,0,0,.05);border-radius:4px;margin:16px auto 14px;vertical-align:middle;width:280px\\" border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\" role=\\"presentation\\"><tbody><tr><td><p style=\\"font-size:32px;line-height:40px;margin:0 auto;color:#000;display:inline-block;font-family:HelveticaNeue-Bold;font-weight:700;letter-spacing:6px;padding-bottom:8px;padding-top:8px;width:100%;text-align:center\\"></p></td></tr></tbody></table><p style=\\"font-size:15px;line-height:23px;margin:0;color:#444;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;letter-spacing:0;padding:0 40px;text-align:center\\">Not expecting this email?</p><p style=\\"font-size:15px;line-height:23px;margin:0;color:#444;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;letter-spacing:0;padding:0 40px;text-align:center\\">Contact <a href=\\"mailto:[email protected]\\" style=\\"color:#444;text-decoration:underline\\">[email protected]</a> if you did not request this code.</p></td></tr></tbody></table><span><!--[if mso]></td></tr></table><![endif]--></span></div></div><p style=\\"font-size:12px;line-height:23px;margin:0;color:#000;font-weight:800;letter-spacing:0;margin-top:20px;font-family:HelveticaNeue,Helvetica,Arial,sans-serif;text-align:center;text-transform:uppercase\\">Securely powered by Plaid.</p></body></html>"`;

packages/plugin-minify/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const settings = {
5959
closeEmptyElements: true,
6060
collapseEmptyAttributes: true,
6161
omitOptionalTags: true,
62-
preferUnquoted: true,
62+
preferUnquoted: false,
6363
quoteSmart: true,
6464
tightAttributes: true,
6565
tightCommaSeparatedLists: true,

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"noEmit": true,
4-
"types": ["vitest/globals"]
4+
"types": ["@types/node", "vitest/globals"]
55
},
66
"extends": "./shared/tsconfig.base.json",
77
"include": ["apps", "packages", "scripts", "shared", "test"]

0 commit comments

Comments
 (0)