mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 01:37:32 +03:00 
			
		
		
		
	Merge da57b154bb into 0b55f34cbf
				
					
				
			This commit is contained in:
		
						commit
						5e3f16e358
					
				| 
						 | 
				
			
			@ -148,6 +148,7 @@
 | 
			
		|||
    "mark.js": "^8.11.1",
 | 
			
		||||
    "marked": "^4.3.0",
 | 
			
		||||
    "mobx-react": "^9.1.1",
 | 
			
		||||
    "nanoid": "^5.1.2",
 | 
			
		||||
    "openapi-sampler": "^1.5.0",
 | 
			
		||||
    "path-browserify": "^1.0.1",
 | 
			
		||||
    "perfect-scrollbar": "^1.5.5",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
import { action, observable, makeObservable } from 'mobx';
 | 
			
		||||
import { nanoid } from 'nanoid';
 | 
			
		||||
 | 
			
		||||
import type { OpenAPIExternalDocumentation, OpenAPITag } from '../../types';
 | 
			
		||||
import { safeSlugify } from '../../utils';
 | 
			
		||||
| 
						 | 
				
			
			@ -37,8 +38,11 @@ export class GroupModel implements IMenuItem {
 | 
			
		|||
  ) {
 | 
			
		||||
    makeObservable(this);
 | 
			
		||||
 | 
			
		||||
    const safeGroupName = safeSlugify(tagOrGroup.name);
 | 
			
		||||
    const groupId = [type, '/', safeGroupName, `_${nanoid(8)}`].join('');
 | 
			
		||||
 | 
			
		||||
    // markdown headings already have ids calculated as they are needed for heading anchors
 | 
			
		||||
    this.id = (tagOrGroup as MarkdownHeading).id || type + '/' + safeSlugify(tagOrGroup.name);
 | 
			
		||||
    this.id = (tagOrGroup as MarkdownHeading).id || groupId;
 | 
			
		||||
    this.type = type;
 | 
			
		||||
    this.name = tagOrGroup['x-displayName'] || tagOrGroup.name;
 | 
			
		||||
    this.level = (tagOrGroup as MarkdownHeading).level || 1;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user