recommeded codeql fix

Signed-off-by: npiyush97 <npiyush35@gmail.com>
This commit is contained in:
npiyush97
2024-04-26 23:01:58 +05:30
parent ba765801da
commit cfacb71538
+9 -1
View File
@@ -73,7 +73,15 @@ const config: Config = {
markdown: {
preprocessor({ fileContent }) {
// Replace all HTML comments with empty strings as these are not supported by MDXv2.
return fileContent.replace(/<!--.*?-->/gs, '');
function removeHtmlComments(input) {
let previous;
do {
previous = input;
input = input.replace(/<!--|--!?>/g, '');
} while (input !== previous);
return input;
}
return removeHtmlComments(fileContent);
},
format: 'detect',
},