Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/fast-bobcats-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"md-to-react-email": major
---

### Changes

- Added [`Marked`](https://marked.js.org/) for markdown transformations
- Removed `ParseMarkdownToReactEmail` function

### Fixes

- Fixed issue with [list parsing](https://github.com/codeskills-dev/md-to-react-email/issues/11)
- Fixed `parseCssInJsToInlineCss` issue with numerical values
18 changes: 3 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Read the documentation [here](https://md2re.codeskills.dev/)

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.

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

### Support

The following markdown flavors are supported

- Offical markdown flavour
- Github flavoured markdown

## Installation

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

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

### Components:
Expand Down Expand Up @@ -75,18 +75,6 @@ npm install md-to-react-email

```

- For code generation (copy and paste)

```
import {parseMarkdownToReactEmail} from "md-to-react-email"

const markdown = `# Hello World`
const parsedReactMail = parseMarkdownToReactEmail(markdown)

console.log(parsedReactMail) // `<Heading as="h1" style={...styles go here...}></Heading>`

```

## Components

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.
Expand All @@ -98,7 +86,7 @@ The following components are available for customization:
- Text: paragraphs, bold and italic text
- Links
- Code: Code blocks and inline code
- Lists: ul, li
- Lists: ul, ol, li
- Image
- Line-breaks (br)
- Horizontal-rule (hr)
Expand Down
2 changes: 1 addition & 1 deletion __tests__/camelToKebabCase.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { camelToKebabCase } from "../src";
import { camelToKebabCase } from "../src/utils";

describe("camelToKebabCase", () => {
it("should convert camel case to kebab case", () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/parseCssInJsToInlineCss.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseCssInJsToInlineCss } from "../src";
import { parseCssInJsToInlineCss } from "../src/utils";

describe("parseCssInJsToInlineCss", () => {
test("should return an empty string for undefined CSS properties", () => {
Expand Down
132 changes: 0 additions & 132 deletions __tests__/parseMarkdownToReactEmail.test.ts

This file was deleted.

Loading