Hello I would like help creating a regex that replaces all html tags but when there is an end div and start div next to each other it adds a space, so for example
This <b>is</b> <div>a</div><div>test</div>
This is a test
What I currently have for regex is /(<([^>]+)>)/ig which will replace all html tags but Im wondering how do I also add a space whenever there is a closing div and starting div next to each other.
I tried using /(<([^>]+)>)/ig to replace the html which works but I need help with the spacing on divs when they are next to each other