Skip to content

Commit b2290fb

Browse files
Merge pull request #2 from ChristianMurphy/types/apply-partial-to-rehype-react
types: apply partial to rehype react options
2 parents 0fabb15 + 027e0a7 commit b2290fb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.github/workflows/gh-page.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy to GitHub pages
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66

77
jobs:
88
build-and-deploy:

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66
pull_request:
7-
branches: [master]
7+
branches: [main]
88

99
jobs:
1010
build:

readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-remark
22

3-
[![CI](https://github.com/ChristianMurphy/react-remark/workflows/CI/badge.svg?branch=master)](https://github.com/ChristianMurphy/react-remark/actions?query=workflow%3ACI)
3+
[![CI](https://github.com/ChristianMurphy/react-remark/workflows/CI/badge.svg?branch=main)](https://github.com/ChristianMurphy/react-remark/actions?query=workflow%3ACI)
44

55
**react-remark** offers a [React hook](https://reactjs.org/docs/hooks-intro.html) and [React component](https://reactjs.org/docs/glossary.html#components) based way of rendering [markdown](https://commonmark.org/) into [React](https://reactjs.org) using [remark](https://github.com/remarkjs/remark)
66

@@ -129,14 +129,14 @@ The source for the story files can be found in [_/stories_](./stories).
129129
+---------------------------------------------------------------------------------------------------------------------------------------------+
130130
```
131131

132-
relevant links: [markdown](https://commonmark.org), [remark](https://github.com/remarkjs/remark), [mdast](https://github.com/syntax-tree/mdast), [remark plugins](https://github.com/remarkjs/remark/blob/master/doc/plugins.md), [remark-rehype](https://github.com/remarkjs/remark-rehype), [hast](https://github.com/syntax-tree/hast), [rehype plugins](https://github.com/rehypejs/rehype/blob/master/doc/plugins.md), [rehype-react](https://github.com/rehypejs/rehype-react)
132+
relevant links: [markdown](https://commonmark.org), [remark](https://github.com/remarkjs/remark), [mdast](https://github.com/syntax-tree/mdast), [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md), [remark-rehype](https://github.com/remarkjs/remark-rehype), [hast](https://github.com/syntax-tree/hast), [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md), [rehype-react](https://github.com/rehypejs/rehype-react)
133133

134134
## Options
135135

136-
- `remarkParseOptions` (Object) - configure how Markdown is parsed, same as [`remark-parse` options](https://github.com/remarkjs/remark/tree/master/packages/remark-parse#options)
137-
- `remarkPlugins` (Array) - [remark plugins](https://github.com/remarkjs/remark/blob/master/doc/plugins.md) or [custom plugins](https://unifiedjs.com/learn/guide/create-a-plugin) to transform markdown content before it is translated to HTML (hast)
136+
- `remarkParseOptions` (Object) - configure how Markdown is parsed, same as [`remark-parse` options](https://github.com/remarkjs/remark/tree/main/packages/remark-parse#options)
137+
- `remarkPlugins` (Array) - [remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md) or [custom plugins](https://unifiedjs.com/learn/guide/create-a-plugin) to transform markdown content before it is translated to HTML (hast)
138138
- `remarkToRehypeOptions` (Object) - configure how Markdown (mdast) is translated into HTML (hast), same as [`remark-rehype` options](https://github.com/remarkjs/remark-rehype#api)
139-
- `rehypePlugins` (Array) - [rehype plugins](https://github.com/rehypejs/rehype/blob/master/doc/plugins.md) or [custom plugins](https://unifiedjs.com/learn/guide/create-a-plugin) to transform HTML (hast) before it is translated to React elements.
139+
- `rehypePlugins` (Array) - [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md) or [custom plugins](https://unifiedjs.com/learn/guide/create-a-plugin) to transform HTML (hast) before it is translated to React elements.
140140
- `rehypeReactOptions` (Object) - configure how HTML (hast) is translated into React elements, same as [`rehype-react` options](https://github.com/rehypejs/rehype-react#options)
141141

142142
### Pass options to hook

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import rehypeReact, { Options as RehypeReactOptions } from 'rehype-react';
1616
export interface UseRemarkOptions {
1717
remarkParseOptions?: Partial<RemarkParseOptions>;
1818
remarkToRehypeOptions?: RemarkRehypeOptions;
19-
rehypeReactOptions?: RehypeReactOptions<typeof createElement>;
19+
rehypeReactOptions?: Partial<RehypeReactOptions<typeof createElement>>;
2020
remarkPlugins?: PluggableList;
2121
rehypePlugins?: PluggableList;
2222
onError?: (err: Error) => void;

0 commit comments

Comments
 (0)