Closed tuzz closed 2 months ago
Hi @tuzz! Does the Mozilla JS version do this? For consistency we should probably make this an option.
Hi @cantino, apologies for the slow reply.
No, the Mozilla JS version doesn't have this feature. I've just pushed a commit to hide it behind an option. Hopefully the feature is useful enough to be considered for inclusion. We've found it really helps for some DOM structures.
Thanks
Thanks @tuzz!
Releases in 0.7.2
If the best candidate is in an element all by itself, then we should probably check its nearest ancestor that has siblings when considering whether to append siblings that meet the score threshold.
For example, in the example below, we would now include the second paragraph whereas previous we would not.
Note that this changes behaviour. We could put this change behind an option if preferred. I think this will improve the extraction for most use cases, though, and none of the existing test cases fail.