mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 09:47:31 +03:00 
			
		
		
		
	fix: attachHeadingsDescriptions match headings incorrectly (#1845)
* fix: attachHeadingsDescriptions match headings incorrectly * fix: match new line instead of `$` in MarkdownRenderer.attachHeadingsDescriptions Co-authored-by: TJT <tjt@maimemo.com>
This commit is contained in:
		
							parent
							
								
									831b207715
								
							
						
					
					
						commit
						ea8573dbd7
					
				| 
						 | 
					@ -101,7 +101,7 @@ export class MarkdownRenderer {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  attachHeadingsDescriptions(rawText: string) {
 | 
					  attachHeadingsDescriptions(rawText: string) {
 | 
				
			||||||
    const buildRegexp = (heading: MarkdownHeading) => {
 | 
					    const buildRegexp = (heading: MarkdownHeading) => {
 | 
				
			||||||
      return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}`);
 | 
					      return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}\s*\n`);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const flatHeadings = this.flattenHeadings(this.headings);
 | 
					    const flatHeadings = this.flattenHeadings(this.headings);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user