Skip to content

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

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft

Gulp-ts #25396

wants to merge 7 commits into from

Conversation

wendevlin
Copy link
Contributor

Proposed change

  • Use TS for gulp build files
    • types would improve the code quality and it's easier to find issues

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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@github-actions github-actions bot added the Build Related to building the code label May 9, 2025
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

This does not escape backslash characters in the input.

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.


Suggested changeset 1
build-scripts/gulp/gallery.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/build-scripts/gulp/gallery.ts b/build-scripts/gulp/gallery.ts
--- a/build-scripts/gulp/gallery.ts
+++ b/build-scripts/gulp/gallery.ts
@@ -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 });
EOF
@@ -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 });
Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions github-actions bot added the GitHub Actions Pull requests that update GitHub Actions code label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Related to building the code cla-signed GitHub Actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant