I have a string of HTML like:
<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 struggling 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.
2