Skip to content

Commit

Permalink
fix: androidauthority.com - Clear polls
Browse files Browse the repository at this point in the history
Remove polls that require JavaScript
  • Loading branch information
jocmp committed Jan 15, 2025
1 parent 97a6b1e commit af3a562
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### 2.3.0

- [a45b329e0a] - fix: Update versants.com to parse figures (Josiah Campbell) [#42](https://github.com/jocmp/mercury-parser/pull/42)
- [68e9b88a8d] - fix: androidauthority.com - Retain h3 tags (Josiah Campbell) [#41](https://github.com/jocmp/mercury-parser/pull/41)
- [68e9b88a8d] - fix: androidauthority.com - Retain heading tags (Josiah Campbell) [#41](https://github.com/jocmp/mercury-parser/pull/41)
- [c2bc68449f] - bump version v2.2.9 -> v2.2.10 (jocmp)

### v2.2.10 (Jan 11, 2025)
Expand Down
5 changes: 3 additions & 2 deletions src/extractors/custom/www.androidauthority.com/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const WwwAndroidauthorityComExtractor = {
// remove if not following a paragraph. Adding this empty paragraph fixes it, and
// the empty paragraph will be removed anyway.
content: {
selectors: ['.d_Dd', '.e_Ac'],
selectors: ['.e_Bc', '.d_Dd'],
transforms: {
ol: node => {
node.attr('class', 'mercury-parser-keep');
Expand All @@ -29,7 +29,8 @@ export const WwwAndroidauthorityComExtractor = {
h3: $node => $node.attr('class', 'mercury-parser-keep'),
},
clean: [
'.d_f .d_nr', // Lead image
'.e_Oh', // Polls
'picture + div', // Lead image text
],
},
};
1 change: 1 addition & 0 deletions src/utils/dom/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const REMOVE_ATTR_LIST = REMOVE_ATTRS.join(',');
export const WHITELIST_ATTRS = [
'src',
'srcset',
'start',
'sizes',
'type',
'href',
Expand Down

0 comments on commit af3a562

Please sign in to comment.