lukasgeiter / gettext-extractor

A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript, JSX and HTML.
MIT License
98 stars 21 forks source link

Provide content options for HTML attribute extractor (fixes #56) #57

Closed arm1n closed 2 years ago

arm1n commented 2 years ago

Hi Lukas,

this PR introduces the possibility to use content options for HtmlExtractors.elementAttribute the same way as for HtmlExtractors.elementContent. As usages including default values should very likely be the same I had to move some code into utils for reusability. Besides, all attributes being used get the same content options applied, which was added in the primitive element extractor. Tests should cover these scenarios.

Looking forward to your feedback, thanks!

arm1n commented 2 years ago

Thanks for your feedback and code review. I've added the changes and would ask you to have one more look, thanks Lukas!

arm1n commented 2 years ago

Reiterated the PR according to your feedback, thanks for taking the time to look into it.

arm1n commented 2 years ago

Thanks for merging Lukas, we should document the content options also on the corresponding wiki page.

lukasgeiter commented 2 years ago

Of course! I'll update the wiki publish a release soon