I want to replace all ®
signs on my website to an <sup>®</sup>
with JavaScript. But I have to care that I only replace them if there is no sup surrounding them already (maybe from CMS users).
I already tried the following but it does not work fine.
html.replace(/(?<!<sup>.{0,})®(?!.{0,}<\/sup>)/g, "<sup>®</sup>")
It does only care for the </sup>
Tag and does not work in Safari cause of an "invalid group specifier name". Maybe someone here can help me with this.