(JavaScript) I have html email template in string. How to colect all inline styles that is using in template?
for example I have input
<div style="min-width:300px;max-width:600px;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;margin:0 auto;" align="center">
<div style="margin: 0 auto;padding: 20px;">
<a href="/" style="text-decoration: none;">
<img src="https://i.ibb.co/KXYtCNT/Logo-wellness-w.png" alt="" width="84px" />
</a>
</div>
</div>
In return I need ['min-width','max-width','overflow-wrap','word-wrap','word-break','margin','padding','text-decoration']
I think the best way use Regex but don't know how to write it. Use something like that for tags:
const tagRegex = /<\/?[\w\d]+>/gi;
and this for styles but doesn't work:
const styleRegex = /(.*?)+:[\w\d]+;/;