Support other tags/attributes
cossssmin opened this issue · comments
Cosmin Popovici commented
Would be useful to be able to add parameters to URLs in img
tags, for example. Right now the plugin only looks for the href
attribute, which means using it on img
or other tags that use src
/srcset
/source
is impossible.
posthtml([
urlParams({
parameters: { utm_source: 'maizzle', utm_campaign: 'Campaign Name', utm_medium: 'email', }
})
])
.process('<img src="https://example.com/image.png">')
.then(result => console.log(result.html)))
Result:
<img src="https://example.com/image.png?utm_campaign=Campaign%20Name&utm_medium=email&utm_source=maizzle">