Embed: Tighten raw URL transform isMatch#78021
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +33 B (0%) Total Size: 7.95 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in c8f45a6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25481771022
|
ntsekouras
left a comment
There was a problem hiding this comment.
Let's try that. Thanks!
|
Thanks for the review, Nik! |
What?
Part of #74734.
PR improves the
type: 'raw'isMatchfor the embed block transform:isURL()from@wordpress/urlfor proper URL validation (rejects malformed inputs likehttps:// foo).https://only —http://embeds aren't supported.https://prefixes (was countinghttps, also fixes brittle matching).getFilename(). Such URLs should be treated as file/image/video/audio blocks, not embeds.<br>-joined URL guard — concatenated URLs with no whitespace still get rejected.Testing Instructions
https://www.youtube.com/watch?v=dQw4w9WgXcQTesting Instructions for Keyboard
Same.
Use of AI Tools
Claude to validate regexes.