mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-04 12:20:19 +03:00
fix: no-var usage
This commit is contained in:
parent
0a01980296
commit
2996e947e9
|
@ -55,7 +55,7 @@ export class MenuBuilder {
|
||||||
const items: ContentItemModel[] = [];
|
const items: ContentItemModel[] = [];
|
||||||
const tagsMap = MenuBuilder.getTagsWithOperations(spec);
|
const tagsMap = MenuBuilder.getTagsWithOperations(spec);
|
||||||
|
|
||||||
var setionToTheEnd = '';
|
let setionToTheEnd = '';
|
||||||
|
|
||||||
options.sectionsAtTheEnd.forEach(function(s) {
|
options.sectionsAtTheEnd.forEach(function(s) {
|
||||||
setionToTheEnd += extractContent(spec.info.description || '', s);
|
setionToTheEnd += extractContent(spec.info.description || '', s);
|
||||||
|
|
|
@ -87,7 +87,7 @@ export function extractContent(md: string, heading: string): string {
|
||||||
const testRegex = new RegExp(`(^|\\n)#\\s?${heading}\\s*\\n`, 'i');
|
const testRegex = new RegExp(`(^|\\n)#\\s?${heading}\\s*\\n`, 'i');
|
||||||
const replaceRegex = new RegExp(`((\\n|^)#\\s*${heading}\\s*(\\n|$)(?:.|\\n)*?)(?=\\n#|$)`, 'i');
|
const replaceRegex = new RegExp(`((\\n|^)#\\s*${heading}\\s*(\\n|$)(?:.|\\n)*?)(?=\\n#|$)`, 'i');
|
||||||
if (testRegex.test(md)) {
|
if (testRegex.test(md)) {
|
||||||
var extractedContent = replaceRegex.exec(md);
|
const extractedContent = replaceRegex.exec(md);
|
||||||
return extractedContent != null ? extractedContent[0] : '';
|
return extractedContent != null ? extractedContent[0] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user