martinheidegger / excerpt-html

Parses a given html text for a good excerpt.
MIT License
11 stars 5 forks source link

Ignore empty leading paragraphs when finding first paragraph #8

Closed pixelastic closed 3 years ago

pixelastic commented 3 years ago

This should fix https://github.com/martinheidegger/excerpt-html/issues/7

This will filter all empty paragraphs before finding the "first" one

martinheidegger commented 3 years ago

I noticed that the CI task was failing and since travis is stopping hosting I moved everything to github actions. However: the tests failed because the code wasn't following lint rules, which I fixed.

Also I modified the test to see if the title/alt tag has any influence for the text rendered (was wondering if that is the case.

Other than that, looks like it works fine! Thank you for the contribution, i published it as 1.2.2 and added you as contributor to the package.json (though without email as I wasn't sure if you wanted to publish this)