Skip to content

Commit 2f5dfe4

Browse files
authored
Merge pull request #12 from codeskills-dev/feat/rewrite
Feat/rewrite
2 parents 044fdba + 0a29db8 commit 2f5dfe4

25 files changed

+448
-1112
lines changed

.changeset/fast-bobcats-battle.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"md-to-react-email": major
3+
---
4+
5+
### Changes
6+
7+
- Added [`Marked`](https://marked.js.org/) for markdown transformations
8+
- Removed `ParseMarkdownToReactEmail` function
9+
10+
### Fixes
11+
12+
- Fixed issue with [list parsing](https://github.com/codeskills-dev/md-to-react-email/issues/11)
13+
- Fixed `parseCssInJsToInlineCss` issue with numerical values

README.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ Read the documentation [here](https://md2re.codeskills.dev/)
66

77
md-to-react-email is a lightweight utility for converting [Markdown](https://www.markdownguide.org/) into valid [React-email](https://react.email) templates. This tool simplifies the process of creating responsive and customizable email templates by leveraging the power of React and Markdown.
88

9+
**Note**: Starting from `version 4`, `md-to-react-email` uses [`Marked`](https://marked.js.org/) for markdown transformation. see all changes [here](/CHANGELOG.md)
10+
911
### Support
1012

1113
The following markdown flavors are supported
1214

1315
- Offical markdown flavour
14-
- Github flavoured markdown
1516

1617
## Installation
1718

@@ -35,7 +36,6 @@ npm install md-to-react-email
3536

3637
- `camelToKebabCase`: converts strings from camelcase ['thisIsCamelCase'] to kebab case ['this-is-kebab-case']
3738
- `parseCssInJsToInlineCss`: converts css styles from css-in-js to inline css e.g fontSize: "18px" => font-size: 18px;
38-
- `parseMarkdownToReactEmail`: parses markdown to a valid react-email string that can be copied and pasted directly into your codebase
3939
- `parseMarkdownToReactEmailJSX`: parses markdown to valid react-email JSX for the client (i.e the browser)
4040

4141
### Components:
@@ -75,18 +75,6 @@ npm install md-to-react-email
7575

7676
```
7777

78-
- For code generation (copy and paste)
79-
80-
```
81-
import {parseMarkdownToReactEmail} from "md-to-react-email"
82-
83-
const markdown = `# Hello World`
84-
const parsedReactMail = parseMarkdownToReactEmail(markdown)
85-
86-
console.log(parsedReactMail) // `<Heading as="h1" style={...styles go here...}></Heading>`
87-
88-
```
89-
9078
## Components
9179

9280
md-to-react-email contains pre-defined react-email and html components for the email template structure and styling. You can modify these components to customize the look and feel of your email template.
@@ -98,7 +86,7 @@ The following components are available for customization:
9886
- Text: paragraphs, bold and italic text
9987
- Links
10088
- Code: Code blocks and inline code
101-
- Lists: ul, li
89+
- Lists: ul, ol, li
10290
- Image
10391
- Line-breaks (br)
10492
- Horizontal-rule (hr)

__tests__/camelToKebabCase.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { camelToKebabCase } from "../src";
1+
import { camelToKebabCase } from "../src/utils";
22

33
describe("camelToKebabCase", () => {
44
it("should convert camel case to kebab case", () => {

__tests__/parseCssInJsToInlineCss.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parseCssInJsToInlineCss } from "../src";
1+
import { parseCssInJsToInlineCss } from "../src/utils";
22

33
describe("parseCssInJsToInlineCss", () => {
44
test("should return an empty string for undefined CSS properties", () => {

__tests__/parseMarkdownToReactEmail.test.ts

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)