Skip to content

Commit 225ad41

Browse files
committed
fix(markdown toc): codeql
1 parent c413970 commit 225ad41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/markdown-toc-generator/markdown-toc-generator.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function getTocMarkdown({
129129
const titles = getTitles(markdown, titleContent => getFinalId(genericAnchorGenerator(titleContent, concatSpaces)));
130130

131131
const createLink = (linkText: string, url: string) => {
132-
return `[${linkText.replace(/\[/g, '\\[').replace(/\]/g, '\\]')}](${url.replace(/\(/g, '%28').replace(/\(/g, '%29')})`;
132+
return `[${linkText.replace(/\\/g, '\\\\').replace(/\[/g, '\\[').replace(/\]/g, '\\]')}](${url.replace(/\(/g, '%28').replace(/\(/g, '%29')})`;
133133
};
134134

135135
let markdownTOC = '';

0 commit comments

Comments
 (0)