Remove file, this is moved into the parser

This commit is contained in:
Jackson Harper 2022-03-02 16:36:36 -08:00
parent b5f9478350
commit d66c114a7d

View file

@ -1,25 +0,0 @@
import { Readability } from '@omnivore/readability';
import { DOMWindow } from 'jsdom'
// Attempt to determine if an HTML blob is a newsletter
// based on it's contents.
export const isProbablyNewsletter = (dom: DOMWindow): boolean => {
const article = new Readability(document, {
debug: false,
keepTables: true,
}).parse()
if (!article || !article.content) {
return false
}
// Maybe it is a substack newsletter
const body = dom.document.querySelector('.email-body-container')
if (body?.querySelector('.post-meta') || body?.querySelector('.post-cta')) {
return true
}
return false
};