Commit ffd8e5c
committed
fix: scope video keyword match to iframe/embed elements
matchesKeyword in is-video-detected.js was checking the "src"
attribute of any element matched by the rule's broad selector
(video, iframe, object, source, [src]:not(script), [role]) for
substrings like "youtube" or "vimeo". Since the selector includes
any [src] element, this flagged plain <img> tags whose filename
happened to contain one of these words, most commonly a featured
image screenshot named like "...-youtube.jpg".
Restrict the keyword check to iframe/embed elements, which is where
a "youtube"/"vimeo" URL actually indicates an embedded video player.
Fixes PRO-1229.1 parent 5198836 commit ffd8e5c
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
0 commit comments