Better targeting in markup for path transformation
davestewart opened this issue · 1 comments
davestewart commented
Background
Right now, supported tags and attributes are internally configured.
This means that whilst an <img src="">
will have its src
transformed, <CustomImage image="" />
will not.
Proposal
Some way to configure per asset or per attribute what to transform, for example, default config:
{
attrsMap: {
'a': 'href',
'*': 'src',
'CustomImage': 'image',
}
}
This would target:
- anchor tags
- anything with a
src
attribute CustomImage
component'simage
attribute
Maybe even:
{
attrsMap: {
'*': 'href src',
'CustomImage': 'image',
}
}
Or maybe even simply test visited nodes to be element
s, then test any string
prop against the hash of paths 👍
davestewart commented
Closed by #11