fix: wrap Code.astro inline script in IIFE to fix top-level return error#1556
fix: wrap Code.astro inline script in IIFE to fix top-level return error#1556saschabuehrle wants to merge 1 commit into
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe inline script in Code.astro that applies diff highlighting (adding ChangesDiff Highlighting Script Fix
Related Issues: Suggested Labels: bug, frontend Suggested Reviewers: (none identified from available information) 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Adammatthiesen
left a comment
There was a problem hiding this comment.
Thanks for helping with this preemptive change on our project, but it needs a changeset and the existing test updated before we can approve and merge.
(See the failing Github Action workflows for more information)
|
@saschabuehrle are you able to apply the requested changes? |
Fixes #1555
The
is:inlinescript in Code.astro uses barereturnstatements for early exits, but since inline scripts get placed directly in a<script>tag in the HTML output,returnoutside a function body is a syntax error.Wrapped the script body in an IIFE so the early returns work as intended.
-- saschabuehrle
Summary by CodeRabbit