import { describe, expect, it } from 'vitest'; import { genericParser } from '../src/parsing/generic.js'; import { selectParser } from '../src/parsing/plugins.js'; describe('parser plugin selection', () => { it('selects Substack for Substack headers and generic otherwise', () => { expect(selectParser({ headers: { listId: 'thing.substack.com' }, html: '' }).name).toBe( 'substack' ); expect( selectParser({ headers: {}, html: 'Example' }).name ).toBe('generic'); }); }); describe('generic parser', () => { it('keeps descriptions local to each link when many links share a container', () => { const links = genericParser.parse({ html: `