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
36 changes: 36 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run Benchmarks.

# publish only when package json has changed - assuming version upgrade
on:
workflow_dispatch:

jobs:
publish:
if: github.event.repository.owner.login == 'md2docx'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Setup Git
run: |
git config --global user.name "mayank1513"
git config --global user.email "mayank.srmu@gmail.com"
- run: npm i -g pnpm && pnpm i
name: Install dependencies
- name: clean up working directory
run: git status && git clean -f -d && git status

- name: Run Benchmarks
run: cd lib && pnpm build && pnpm benchmark
- name: Save benchmarks back to repo
run: git add . && git commit -m "Update benchmarks" && git push
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: pnpm test
working-directory: ./lib
- name: Copy Readme file
run: cp ./README.md ./lib # will be uncommented while rebranding
run: cp ./README.md ./lib
- name: Apply changesets, publish and create release, branches and tags
run: node ./scripts/publish.js
env:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ export default function Page() {
Unlike most markdown renderers, `@m2d/react-markdown` supports **arbitrary JSX as children**:

```tsx
<Md>
import { Mdx } from "@m2d/react-markdown/server";
// ...
<Mdx>
<article>{"# Markdown Heading\n\nSome **rich** content."}</article>
</Md>
</Mdx>;
```

> `astRef.current` is an array — one per Markdown string — each with `{ mdast, hast }`.
> The default `<Md>` export accepts only string children for better optimization.

---

Expand Down
Loading
Loading