mirror of
https://github.com/postlight/mercury-parser
synced 2024-11-05 12:00:13 +00:00
fix: selection should not be empty
This commit is contained in:
parent
81ed4f00ed
commit
457075889d
@ -53,7 +53,7 @@ export function select(opts) {
|
|||||||
|
|
||||||
const { selectors } = extractionOpts;
|
const { selectors } = extractionOpts;
|
||||||
|
|
||||||
const matchingSelector = selectors.find(selector => $(selector).length === 1);
|
const matchingSelector = selectors.find(selector => $(selector).length === 1 && $(selector).text().trim() !== '');
|
||||||
|
|
||||||
if (!matchingSelector) return null;
|
if (!matchingSelector) return null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user