-
Notifications
You must be signed in to change notification settings - Fork 2
chore: update llms.txt #460
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for canarychecker canceled.
|
|
Caution Review failedThe pull request is closed. WalkthroughThe pull request removes the Changes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| } | ||
|
|
||
| function stripHtmlComments(content) { | ||
| return content.replace(/<!--[\s\S]*?-->/g, ''); |
Check failure
Code scanning / CodeQL
Incomplete multi-character sanitization High
<!--
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 days ago
In general, to fix incomplete multi-character sanitization, either (a) apply the replacement repeatedly until no further matches occur, or (b) switch to a well-tested sanitization library that correctly handles HTML comments and edge cases. Here, the simplest, behavior-preserving approach is to keep the existing regex but iterate until no more replacements happen. This ensures that any new <!--...--> sequences that might be formed after a replacement are also removed.
Concretely, in mission-control/scripts/move-llms.mjs, we should modify stripHtmlComments (lines 174–176) so it no longer performs a single replace call. Instead, we introduce a small loop: keep a previous string, repeatedly call replace(/<!--[\s\S]*?-->/g, '') until the result is identical to the previous value, then return the final string. This preserves all existing calling code and behavior for normal inputs while closing the edge case highlighted by CodeQL. No additional imports or external libraries are required.
-
Copy modified lines R175-R181
| @@ -172,7 +172,13 @@ | ||
| } | ||
|
|
||
| function stripHtmlComments(content) { | ||
| return content.replace(/<!--[\s\S]*?-->/g, ''); | ||
| let previous; | ||
| let current = content; | ||
| do { | ||
| previous = current; | ||
| current = current.replace(/<!--[\s\S]*?-->/g, ''); | ||
| } while (current !== previous); | ||
| return current; | ||
| } | ||
|
|
||
| function cleanupOutput(content) { |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.