Our slug generation code uses the stateful version of github slugger
which assigns different names to different slugs e.g. `thing`,
`thing-1`, `thing-2` each time it's called. This means that our links
across pages are broken because the slugs get generated with a suffix.
This replaces it with the non-stateful version instead.
pull/3228/head
alex 2024-03-20 13:34:47 +00:00 zatwierdzone przez GitHub
rodzic 72ae8ddefd
commit d5dc306314
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 2 dodań i 4 usunięć

Wyświetl plik

@ -11,9 +11,7 @@ import {
DocSoftBreak,
} from '@microsoft/tsdoc'
import assert from 'assert'
import GithubSlugger from 'github-slugger'
const slugs = new GithubSlugger()
import { slug as githubSlug } from 'github-slugger'
import path from 'path'
import prettier from 'prettier'
@ -50,7 +48,7 @@ function isOnParentPage(itemKind: ApiItemKind) {
}
export function getSlug(item: ApiItem): string {
return slugs.slug(item.displayName, true)
return githubSlug(item.displayName, true)
}
export function getPath(item: ApiItem): string {