I got a string of HTML like e.g.
<p class="fade">Hello "Mr Crabs" <strong>you make the "best" burgers</strong>.</p>
The goal is to replace all “….” with „…“ but only outside of tags.
So the expected result would be
<p class="fade">Hello „Mr Crabs“ <strong>you make the „best“ burgers</strong>.</p>
I am fairly sure this can be done using a regex but I am struggeling to create a working one.
So far I came up with this one
.replace(/"(.*?)"/g, '„$1“')
But it also replaces the “fade” quotes inside the p-tags.