Skip to content

Commit

Permalink
Update website/docs/guides/markdown-features/markdown-features-plugin…
Browse files Browse the repository at this point in the history
…s.mdx
  • Loading branch information
slorber authored Apr 11, 2024
1 parent ad37370 commit 1ae3054
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 1ae3054

Please sign in to comment.