react-email 6.0.1 → 6.0.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/CHANGELOG.md
CHANGED
package/dist/cli/index.mjs
CHANGED
|
@@ -6522,7 +6522,7 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
|
|
|
6522
6522
|
//#region package.json
|
|
6523
6523
|
var package_default = {
|
|
6524
6524
|
name: "react-email",
|
|
6525
|
-
version: "6.0.
|
|
6525
|
+
version: "6.0.2",
|
|
6526
6526
|
description: "A live preview of your emails right in your browser.",
|
|
6527
6527
|
bin: { "email": "./dist/cli/index.mjs" },
|
|
6528
6528
|
type: "module",
|
package/dist/index.cjs
CHANGED
|
@@ -17810,8 +17810,9 @@ const Markdown = react.forwardRef(({ children, markdownContainerStyles, markdown
|
|
|
17810
17810
|
const text = renderer.parser.parseInline(tokens);
|
|
17811
17811
|
return `<a href="${href}" target="_blank"${title ? ` title="${title}"` : ""}${parseCssInJsToInlineCss(finalStyles.link) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.link)}"` : ""}>${text}</a>`;
|
|
17812
17812
|
};
|
|
17813
|
-
renderer.listitem = ({ tokens }) => {
|
|
17814
|
-
const
|
|
17813
|
+
renderer.listitem = ({ tokens, loose }) => {
|
|
17814
|
+
const hasNestedList = tokens.some((token) => token.type === "list");
|
|
17815
|
+
const text = loose || hasNestedList ? renderer.parser.parse(tokens) : renderer.parser.parseInline(tokens);
|
|
17815
17816
|
return `<li${parseCssInJsToInlineCss(finalStyles.li) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.li)}"` : ""}>${text}</li>\n`;
|
|
17816
17817
|
};
|
|
17817
17818
|
renderer.list = ({ items, ordered, start }) => {
|
package/dist/index.mjs
CHANGED
|
@@ -17789,8 +17789,9 @@ const Markdown = React$1.forwardRef(({ children, markdownContainerStyles, markdo
|
|
|
17789
17789
|
const text = renderer.parser.parseInline(tokens);
|
|
17790
17790
|
return `<a href="${href}" target="_blank"${title ? ` title="${title}"` : ""}${parseCssInJsToInlineCss(finalStyles.link) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.link)}"` : ""}>${text}</a>`;
|
|
17791
17791
|
};
|
|
17792
|
-
renderer.listitem = ({ tokens }) => {
|
|
17793
|
-
const
|
|
17792
|
+
renderer.listitem = ({ tokens, loose }) => {
|
|
17793
|
+
const hasNestedList = tokens.some((token) => token.type === "list");
|
|
17794
|
+
const text = loose || hasNestedList ? renderer.parser.parse(tokens) : renderer.parser.parseInline(tokens);
|
|
17794
17795
|
return `<li${parseCssInJsToInlineCss(finalStyles.li) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.li)}"` : ""}>${text}</li>\n`;
|
|
17795
17796
|
};
|
|
17796
17797
|
renderer.list = ({ items, ordered, start }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-email",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "A live preview of your emails right in your browser.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"email": "./dist/cli/index.mjs"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"marked": "^15.0.12",
|
|
47
47
|
"mime-types": "^3.0.0",
|
|
48
48
|
"normalize-path": "^3.0.0",
|
|
49
|
-
"nypm": "0.6.
|
|
49
|
+
"nypm": "0.6.6",
|
|
50
50
|
"ora": "^8.0.0",
|
|
51
51
|
"prismjs": "^1.30.0",
|
|
52
52
|
"prompts": "2.4.2",
|
|
@@ -153,6 +153,28 @@ console.log(\`Hello, $\{name}!\`);
|
|
|
153
153
|
`);
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
+
it('renders loose lists with paragraph continuations without crashing', async () => {
|
|
157
|
+
const actualOutput = await render(
|
|
158
|
+
<Markdown>
|
|
159
|
+
{`- item1
|
|
160
|
+
|
|
161
|
+
paragraph continuation
|
|
162
|
+
|
|
163
|
+
- item2`}
|
|
164
|
+
</Markdown>,
|
|
165
|
+
);
|
|
166
|
+
expect(actualOutput).toMatchInlineSnapshot(`
|
|
167
|
+
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><div data-id="react-email-markdown"><ul>
|
|
168
|
+
<li><p>item1</p>
|
|
169
|
+
<p>paragraph continuation</p>
|
|
170
|
+
</li>
|
|
171
|
+
<li><p>item2</p>
|
|
172
|
+
</li>
|
|
173
|
+
</ul>
|
|
174
|
+
</div><!--/$-->"
|
|
175
|
+
`);
|
|
176
|
+
});
|
|
177
|
+
|
|
156
178
|
it('renders nested lists in the correct format for browsers', async () => {
|
|
157
179
|
const actualOutput = await render(
|
|
158
180
|
<Markdown>
|
|
@@ -118,11 +118,12 @@ export const Markdown = React.forwardRef<HTMLDivElement, MarkdownProps>(
|
|
|
118
118
|
}>${text}</a>`;
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
renderer.listitem = ({ tokens }) => {
|
|
121
|
+
renderer.listitem = ({ tokens, loose }) => {
|
|
122
122
|
const hasNestedList = tokens.some((token) => token.type === 'list');
|
|
123
|
-
const text =
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
const text =
|
|
124
|
+
loose || hasNestedList
|
|
125
|
+
? renderer.parser.parse(tokens)
|
|
126
|
+
: renderer.parser.parseInline(tokens);
|
|
126
127
|
|
|
127
128
|
return `<li${
|
|
128
129
|
parseCssInJsToInlineCss(finalStyles.li) !== ''
|