Remove deprecated type attribute from link and script tags#68
Remove deprecated type attribute from link and script tags#68koriym wants to merge 1 commit intoauraphp:6.xfrom
Conversation
WalkthroughThe changes remove explicit MIME type attributes ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧬 Code graph analysis (1)src/Helper/Scripts.php (1)
🔇 Additional comments (10)
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 |
| { | ||
| $attr = $this->attr(null, $attr); | ||
| $tag = "<script $attr>$script</script>"; | ||
| $tag = $attr ? "<script $attr>$script</script>" : "<script>$script</script>"; |
There was a problem hiding this comment.
Do we need this ? I think $attr will be empty string if $attr is empty. Any reason you bring this ?
There was a problem hiding this comment.
Without the ternary, an empty $attr produces a trailing space:
// $attr = '' (empty string)
"<script $attr>$script</script>"
// outputs: "<script >$script</script>"
The ternary ensures clean output:
"<script>$script</script>"
Summary
Following up on PR #64, this PR removes the remaining deprecated
typeattributes:type="text/css"from<link>tags infixAttr()type="text/javascript"from<script>tags inattr()In HTML5,
type="text/css"for stylesheets andtype="text/javascript"for scripts are the defaults and no longer required.Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
Summary by CodeRabbit
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.