Skip to content

Commit d035bde

Browse files
authored
Merge pull request #14 from klaasman/patch-1
Fix: unordered lists styles
2 parents ce3d95b + 147a2f5 commit d035bde

File tree

9 files changed

+28
-344
lines changed

9 files changed

+28
-344
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.changeset/lazy-actors-design.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"md-to-react-email": minor
3+
---
4+
5+
### Changes
6+
7+
- Remove `DOMPurify` from lib
8+
9+
### Fixes
10+
11+
- Fixed unordered list `ul` styles

__tests__/parseMarkdownToReactEmailJSX.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ console.log(\`Hello, \$\{name\}!\`);
6363
<li>Unordered List Item 2</li>
6464
<li>Unordered List Item 3</li>
6565
</ul>
66-
<h2 style=\"font-weight:500;padding-top:20px;font-size:2rem\">Links</h2><p><a style=\"color:#007bff;text-decoration:underline;background-color:transparent\" href=\"https://www.markdownguide.org\" target=\"_blank\">Markdown Guide</a></p>
67-
<h2 style=\"font-weight:500;padding-top:20px;font-size:2rem\">Images</h2><p><img alt=\"Markdown Logo\" src=\"https://markdown-here.com/img/icon256.png\"></p>
66+
<h2 style=\"font-weight:500;padding-top:20px;font-size:2rem\">Links</h2><p><a href=\"https://www.markdownguide.org\" target=\"_blank\" style=\"color:#007bff;text-decoration:underline;background-color:transparent\">Markdown Guide</a></p>
67+
<h2 style=\"font-weight:500;padding-top:20px;font-size:2rem\">Images</h2><p><img src=\"https://markdown-here.com/img/icon256.png\" alt=\"Markdown Logo\"></p>
6868
<h2 style=\"font-weight:500;padding-top:20px;font-size:2rem\">Blockquotes</h2><blockquote style=\"background:#f9f9f9;border-left:10px solid #ccc;margin:1.5em 10px;padding:1em 10px\">
6969
<p>This is a blockquote.</p>
7070
<ul>
@@ -232,12 +232,12 @@ greet("World")
232232

233233
it("handles blockquotes correctly", () => {
234234
const markdown = `A example:
235-
> Here's a block quote:
235+
> Here\'s a block quote:
236236
> Lorem ipsum dolor sit amet, consectetur adipiscing elit.`;
237237

238238
const expected = `<p>A example:</p>
239239
<blockquote style="background:#f9f9f9;border-left:10px solid #ccc;margin:1.5em 10px;padding:1em 10px">
240-
<p>Here's a block quote:
240+
<p>Here&#39;s a block quote:
241241
Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
242242
</blockquote>
243243
`;
@@ -264,10 +264,10 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
264264

265265
it("handles links correctly", () => {
266266
const markdown = `A link example:
267-
Here's a link to [OpenAI's website](https://openai.com/).`;
267+
Here's a link to [OpenAI\'s website](https://openai.com/).`;
268268

269269
const expected = `<p>A link example:
270-
Here's a link to <a style="color:#007bff;text-decoration:underline;background-color:transparent" href="https://openai.com/" target="_blank">OpenAI's website</a>.</p>
270+
Here&#39;s a link to <a href="https://openai.com/" target="_blank" style="color:#007bff;text-decoration:underline;background-color:transparent">OpenAI&#39;s website</a>.</p>
271271
`;
272272

273273
const rendered = parseMarkdownToReactEmailJSX({

__tests__/reactEmailMarkdown.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe("ReactEmailMarkdown component renders correctly", () => {
88
<ReactEmailMarkdown markdown={`# Hello, World!`} />
99
);
1010
expect(actualOutput).toMatchInlineSnapshot(
11-
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><div><h1 data-id="react-email-heading" style="font-weight:500;padding-top:20px;font-size:2.5rem">Hello, World!</h1></div>"`
11+
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><div><h1 style="font-weight:500;padding-top:20px;font-size:2.5rem" data-id="react-email-heading">Hello, World!</h1></div>"`
1212
);
1313
});
1414
});

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"react-email": ">1.9.3"
5151
},
5252
"dependencies": {
53-
"isomorphic-dompurify": "1.7.0",
5453
"marked": "7.0.4"
5554
},
5655
"publishConfig": {

0 commit comments

Comments
 (0)