-
-
Notifications
You must be signed in to change notification settings - Fork 883
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove support for passing custom props to components
Previously, this project automatically passed different extra props to particular components. Those props are sometimes useful to some people, but not always useful to everyone. When overwriting components, these props are no longer passed: * `inline` on `code`: — create a plugin or use `pre` for the block * `level` on `h1`, `h2`, `h3`, `h4`, `h5`, `h6` — check `node.tagName` instead * `checked` on `li` — check `task-list-item` class or check `props.children` * `index` on `li` — create a plugin * `ordered` on `li` — create a plugin or check the parent * `depth` on `ol`, `ul` — create a plugin * `ordered` on `ol`, `ul` — check `node.tagName` instead * `isHeader` on `td`, `th` — check `node.tagName` instead * `isHeader` on `tr` — create a plugin or check children When using options, these props are no longer passed: * `includeElementIndex`: `index` (create a plugin) * `rawSourcePos`: `sourcePosition` (use `node.position`) * `sourcePos`: `data-sourcepos` (create a plugin)
- Loading branch information
Showing
10 changed files
with
449 additions
and
906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
/** | ||
* @typedef {import('./lib/react-markdown.js').Options} Options | ||
* @typedef {import('./lib/ast-to-react.js').Components} Components | ||
* @typedef {import('hast-util-to-jsx-runtime').Components} Components | ||
* @typedef {import('hast-util-to-jsx-runtime').ExtraProps} ExtraProps | ||
* @typedef {import('./lib/index.js').Options} Options | ||
*/ | ||
|
||
export {uriTransformer} from './lib/uri-transformer.js' | ||
|
||
export {ReactMarkdown as default} from './lib/react-markdown.js' | ||
export {ReactMarkdown as default, uriTransformer} from './lib/index.js' |
Oops, something went wrong.