mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 02:23:43 +03:00
fix: Slugifying non-ascii headers make duplicate permalinks (#264)
This commit is contained in:
parent
0341db4559
commit
6edbbe7b0c
|
@ -53,7 +53,8 @@ export class MdRenderer {
|
|||
}
|
||||
|
||||
saveHeading(title: string, parent:MarkdownHeading = {id:null, children: this.headings}) :MarkdownHeading {
|
||||
let slug = slugify(title);
|
||||
// if title contains some non-ASCII characters (e.g. chinese) slugify returns empty string
|
||||
let slug = slugify(title) || title;
|
||||
let id = slug;
|
||||
if (parent && parent.id) id = `${parent.id}/${id}`;
|
||||
parent.children = parent.children || {};
|
||||
|
|
Loading…
Reference in New Issue
Block a user