Skip to content

Commit

Permalink
docs: visit is a named export of unist-util-visit (#10039)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Lorber <[email protected]>
  • Loading branch information
pearmini and slorber committed Apr 11, 2024
1 parent ba6c59b commit 721f145
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ The writeup below is **not** meant to be a comprehensive guide to creating a plu
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate npm package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.

```js "src/remark/section-prefix.js"
import visit from 'unist-util-visit';
import {visit} from 'unist-util-visit';

const plugin = (options) => {
const transformer = async (ast) => {
Expand Down

0 comments on commit 721f145

Please sign in to comment.