I need to replace vanilla <a>
tag by different tag (<router-link>
) in whole project. The main problem is to do it with some conditions based on href
value (e.g. it should ignore href with "#"
).
I wrote regex, but it was really massive and sometimes cause issues.
After some research I found that webstorm(and other) has "Structural Replace" feature which help with it. I create follow structural replace: Main poins:
$before$
and $after$
have count filter = [0, infinity]$before$
ignore 'href'$href$
has script which filter some values