Skip to content

Commit 8d3502b

Browse files
committed
fix: transform noscript images
1 parent 8893af2 commit 8d3502b

File tree

1 file changed

+5
-4
lines changed
  • src/extractors/custom/www.fortinet.com

1 file changed

+5
-4
lines changed

src/extractors/custom/www.fortinet.com/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import cheerio from 'cheerio';
2+
13
export const WwwFortinetComExtractor = {
24
domain: 'www.fortinet.com',
35

@@ -26,16 +28,15 @@ export const WwwFortinetComExtractor = {
2628
},
2729

2830
content: {
29-
defaultCleaner: false,
30-
3131
selectors: [
3232
'div.responsivegrid.aem-GridColumn.aem-GridColumn--default--12',
3333
],
3434

3535
transforms: {
3636
noscript: ($node) => {
37-
const $children = $node.children();
38-
if ($children.length === 1 && $children.get(0).tagName === 'img') {
37+
const $ = cheerio.load(`<div>${$node.html()}</div>`);
38+
const $children = $('div').children();
39+
if ($children.length === 1 && $children.get(0).tagName === 'IMG') {
3940
return 'figure';
4041
}
4142

0 commit comments

Comments
 (0)