docs: visit is a named export of unist-util-visit (#10039)

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
Bairui Su 2024-04-11 23:40:54 +08:00 committed by GitHub
parent ba6c59bbcb
commit 721f14537d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) => {