Jump to content

How do I superscript ® symbol globally across a site?

Recommended Posts

  • erinsydd changed the title to How do I superscript ® symbol globally across a site?
  • Replies 2
  • Views 331
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Yes, it was causing some images on the pages to disappear... Here's the code:

<script>
  /* superscripting all ® which aren't already */
window.addEventListener("DOMContentLoaded", function(){
    document.querySelectorAll("p, a, h1, h2, h3, h4, h5, h6, label").forEach(function (el) {
        el.innerHTML = el.innerHTML.replace(/®(?!\<\/sup)/g, "<sup>®</sup>");
    })
});
</script>

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.