Skip to content

Commit

Permalink
replace filter with nth-child selector
Browse files Browse the repository at this point in the history
  • Loading branch information
pirxpilot committed Dec 13, 2024
1 parent e34d097 commit c812478
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions lib/resorts/blue-mountain-pa/index.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
const liftNames = [
'Comet Quad',
'Challenge Express',
'Main Street Express',
'Vista Chair',
'Summit School Conveyor',
'Frontier Conveyor Lower',
'Frontier Conveyor Middle',
'Frontier Conveyor Upper',
'Valley School Triple',
'Valley Conveyor Lower',
'Valley Conveyor Middle',
'Valley Conveyor Upper',
];

module.exports = {
selector: '.wp-block-column.is-layout-flow.wp-block-column-is-layout-flow',
selector: '.wp-block-p3-wpo-container:nth-child(3) .wp-block-column',
parse: {
filter: node => {
for (const child of Array.from(node.children)) {
if (child.name === 'h5' && child.children?.[0]) {
const textContent = child.children[0].data;
if (liftNames.includes(textContent.trim())) {
return true;
}
}
}
return false;
},
name: '0',
name: 0,
status: {
child: '1/0/0',
attribute: 'src',
Expand Down

0 comments on commit c812478

Please sign in to comment.