Skip to content

Commit bc80c23

Browse files
committed
chore: Add note about rehype-slug-custom-id
1 parent 5b6f1f6 commit bc80c23

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/gatsby-plugin-mdx/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ As MDX v2 changed the way it handles content you might need to update your MDX f
706706

707707
- HTML syntax doesn’t work in MDX as it’s replaced by JSX (`<img>` to `<img />`). Instead of HTML comments, you can use JavaScript comments in braces: `{/* comment! */}`
708708
- Unescaped left angle bracket / less than (`<`) and left curly brace (`{`) have to be escaped: `\<` or `\{` (or use expressions: `{'<'}`, `{'{'}`)
709+
- If you're using the `enableCustomId` option from `gatsby-remark-autolink-headers` you'll run into problems due to the above. You need to disable this option and use [`rehype-slug-custom-id`](https://github.com/unicorn-utterances/rehype-slug-custom-id) instead.
709710

710711
In our testing, most of the time the issue were curly brackets that needed to be escaped with backticks:
711712

packages/gatsby-remark-autolink-headers/README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ This is a sub-plugin for `gatsby-transformer-remark`. As demoed below, add this
66

77
## Install
88

9-
`npm install gatsby-remark-autolink-headers`
9+
```
10+
npm install gatsby-remark-autolink-headers
11+
```
1012

1113
## How to use
1214

@@ -24,7 +26,7 @@ module.exports = {
2426
}
2527
```
2628

27-
Note: if you are using `gatsby-remark-prismjs`, make sure that it’s listed after this plugin. Otherwise, you might face an issue described here: https://github.com/gatsbyjs/gatsby/issues/5764.
29+
**Please note:** If you are using `gatsby-remark-prismjs`, make sure that it’s listed after this plugin. Otherwise, you might face an issue with [redudant details](https://github.com/gatsbyjs/gatsby/issues/5764).
2830

2931
```javascript
3032
// good
@@ -88,6 +90,8 @@ module.exports = {
8890
}
8991
```
9092

93+
**Please note:** The `enableCustomId` option is not compatible with `gatsby-plugin-mdx` as the syntax is invalid in MDX v2. You should use [`rehype-slug-custom-id`](https://github.com/unicorn-utterances/rehype-slug-custom-id) instead.
94+
9195
## How to style the anchor link
9296

9397
By default, the anchor link has a class of `anchor` (see `className` option to change this name) on the element but has no additional styling. To make it fit your website, you'll have to write some CSS to change the appearance.
@@ -100,4 +104,4 @@ a.anchor {
100104
}
101105
```
102106

103-
Note: There are a variety of approaches to styling your Gatsby site, see [styling documentation](https://www.gatsbyjs.com/docs/styling/) for more detail.
107+
**Please note:** There are a variety of approaches to styling your Gatsby site, see [styling documentation](https://www.gatsbyjs.com/docs/styling/) for more detail.

0 commit comments

Comments
 (0)