An open API service indexing awesome lists of open source software.

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

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": {}
}
```