Skip to content

Commit

Permalink
fix: Keep nested h3's in tldr.tech
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Feb 2, 2025
1 parent d50a54d commit 617b694
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/extractors/custom/tldr.tech/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const TldrTechExtractor = {
domain: 'tldr.tech',

title: {
selectors: [['meta[name="og:title"]', 'value'], 'title'],
selectors: ['h1'],
},

lead_image_url: {
Expand All @@ -14,7 +14,7 @@ export const TldrTechExtractor = {

transforms: {
h2: $node => $node.attr('class', 'mercury-parser-keep'),
h3: $node => $node.attr('class', 'mercury-parser-keep'),
h3: 'b',
},

clean: [],
Expand Down
5 changes: 1 addition & 4 deletions src/extractors/custom/tldr.tech/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ describe('TldrTechExtractor', () => {
it('returns the title', async () => {
const { title } = await result;

assert.equal(
title,
`OpenAI eyes $340B valuation 💰, Gemini 2.0 🤖, Javascript Temporal 👨‍💻`
);
assert.equal(title, `TLDR 2025-01-31`);
});
it('returns the lead_image_url', async () => {
const { lead_image_url } = await result;
Expand Down

0 comments on commit 617b694

Please sign in to comment.