https://github.com/codeandweb/gatsby-mdx-autoheader-bug
Repository to reproduce a bug in Gatsby
https://github.com/codeandweb/gatsby-mdx-autoheader-bug
Last synced: 11 months ago
JSON representation
Repository to reproduce a bug in Gatsby
- Host: GitHub
- URL: https://github.com/codeandweb/gatsby-mdx-autoheader-bug
- Owner: CodeAndWeb
- License: 0bsd
- Created: 2021-03-20T09:51:18.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-20T09:52:44.000Z (over 5 years ago)
- Last Synced: 2025-02-25T06:43:42.218Z (over 1 year ago)
- Language: JavaScript
- Size: 201 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gatsby mdx test project to reproduce a bug in TOC creation
This demo uses `gatsby-remark-autolink-headers` with `enableCustomId: true` to
create headers with custom link targets:
# Header {#header}
## SubHeader {#subheader}
The result is that the html code is produced as it should be: `{#header}` is removed,
the `id` is applied to the `
`:
Header
BUT: The TOC is not using new IDs and headers:
```graphql
query MyQuery {
allMdx {
nodes {
tableOfContents
}
}
}
```
```json
{
"data": {
"allMdx": {
"nodes": [
{
"tableOfContents": {
"items": [
{
"url": "#header-header",
"title": "Header {#header}",
"items": [
{
"url": "#subheader-subheader",
"title": "SubHeader {#subheader}"
}
]
}
]
}
}
]
}
},
"extensions": {}
}
```