-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Heading ID CI flakiness (#7141)
* feat: use `ctx` object instead of leaky global * test: heading IDs stale caches * chore: changeset
- Loading branch information
1 parent
1473737
commit a9e1cd7
Showing
10 changed files
with
154 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@astrojs/markdoc': patch | ||
--- | ||
|
||
Fix inconsistent Markdoc heading IDs for documents with the same headings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { heading } from './heading.js'; | ||
export { headingSlugger } from './heading.js'; | ||
export { setupHeadingConfig } from './heading.js'; | ||
|
||
export const nodes = { heading }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ns/markdoc/test/fixtures/headings-custom/src/content/docs/headings-stale-cache-check.mdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Our heading ID generator can have a stale cache for duplicates. Let's check for those! | ||
|
||
# Level 1 heading | ||
|
||
## Level **2 heading** | ||
|
||
### Level _3 heading_ | ||
|
||
#### Level [4 heading](/with-a-link) | ||
|
||
##### Level 5 heading with override {% #id-override %} | ||
|
||
###### Level 6 heading |
12 changes: 9 additions & 3 deletions
12
...res/headings-custom/src/pages/index.astro → ...es/headings-custom/src/pages/[slug].astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...egrations/markdoc/test/fixtures/headings/src/content/docs/headings-stale-cache-check.mdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Our heading ID generator can have a stale cache for duplicates. Let's check for those! | ||
|
||
# Level 1 heading | ||
|
||
## Level **2 heading** | ||
|
||
### Level _3 heading_ | ||
|
||
#### Level [4 heading](/with-a-link) | ||
|
||
##### Level 5 heading with override {% #id-override %} | ||
|
||
###### Level 6 heading |
12 changes: 9 additions & 3 deletions
12
...t/fixtures/headings/src/pages/index.astro → .../fixtures/headings/src/pages/[slug].astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters