• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / e1f834bd916861c1418cb5c321609504f77c8e72

16 Jan 2026 02:08PM UTC coverage: 53.19% (+0.4%) from 52.832%
e1f834bd916861c1418cb5c321609504f77c8e72

Pull #22887

github

web-flow
Merge 2cb556c24 into 36a71a2d0
Pull Request #22887: Add a new key for step attribute and adapt the relevant code and make…

8774 of 16370 branches covered (53.6%)

Branch coverage included in aggregate %.

5 of 135 new or added lines in 14 files covered. (3.7%)

42 existing lines in 4 files now uncovered.

32905 of 61988 relevant lines covered (53.08%)

46516.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/js/src/structured-data-blocks/shared-utils/getImageElements.js
1
import parse from "html-react-parser";
2

3
/**
4
 * Gets all image elements from the given content.
5
 *
6
 * @param {string} content The content to search for image elements.
7
 * @returns {Array} An array of image elements found in the content.
8
 */
NEW
9
export const getImageElements = ( content ) => {
×
NEW
10
        if ( typeof content !== "string" || ! content.includes( "<img" ) ) {
×
NEW
11
                return [];
×
12
        }
NEW
13
        const foundImages = [ ...content.matchAll( /<img[^>]+src=["']([^"']+)["'][^>]*>/ig ) ];
×
NEW
14
        const imageElements = [];
×
NEW
15
        foundImages.forEach( ( match ) => {
×
NEW
16
                const imgTag = match[ 0 ];
×
NEW
17
                const parsedElements = parse( imgTag );
×
NEW
18
                imageElements.push( parsedElements );
×
19
        } );
NEW
20
        return imageElements;
×
21
};
22

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc