Open ProLoser opened 10 years ago
Yea I think all of those would be good additions. Correctly placing a new element inside the HTML is a little hairy with a DOM-based solution since you don't get to use comment markers like you would if you're just doing string parsing/replacement. before
and after
would alleviate that somewhat. replace
also seems to have a very generic applicability.
This is more a RFC cuz I'm not 100% sure this is necessary.
What do you think about adding a
replace
,after
andbefore
options?The reason is because we had to replace a LESS import to a CSS import and rather than doing 3 separate updates it was easier to just replace. You can't append/prepend however since a
<link>
doesn't have children.Also, theoretically if you have
after
orbefore
you don't need replace since you can just remove the original element afterwards.