-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Gulp-ts #25396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
descriptionContent = marked(descriptionContent).replace(/`/g, "\\`"); | ||
// eslint-disable-next-line no-await-in-loop | ||
descriptionContent = await marked(descriptionContent); | ||
descriptionContent = descriptionContent.replace(/`/g, "\\`"); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 days ago
To fix the issue, we need to ensure that backslashes in descriptionContent
are properly escaped before embedding the string in a JavaScript template literal. This can be achieved by modifying the replace
method to handle both backslashes and backticks (\
and `
). Specifically, we should use a regular expression with the global flag (g
) to replace all occurrences of these characters.
The updated code will replace backslashes (\
) with double backslashes (\\
) and backticks (`
) with escaped backticks (```). This ensures that the string is safely embedded in the template literal.
-
Copy modified line R68
@@ -67,3 +67,3 @@ | ||
descriptionContent = await marked(descriptionContent); | ||
descriptionContent = descriptionContent.replace(/`/g, "\\`"); | ||
descriptionContent = descriptionContent.replace(/\\/g, "\\\\").replace(/`/g, "\\`"); | ||
fs.mkdirSync(path.resolve(galleryBuild, category), { recursive: true }); |
Proposed change
compilation doesn't work
rspack stops at 8% of compilation, I was so far not able to get why this happens and I havn't got any logs from rspack.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: