Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Last active December 19, 2022 14:39
Show Gist options
  • Save nocodesupplyco/44e4fdc9fcb0e6ee57c38de770987b4d to your computer and use it in GitHub Desktop.
Save nocodesupplyco/44e4fdc9fcb0e6ee57c38de770987b4d to your computer and use it in GitHub Desktop.
Superscript All Registered(®) Trademark Characters
/* Style all <sup> elements */
sup {
position: relative;
top: -0.5em;
font-size: 0.6em;
}
// Find all ® characters and wrap them in a <sup> element -->
$('body :not(script,sup)').contents().filter(function() {
return this.nodeType === 3;
}).replaceWith(function() {
return this.nodeValue.replace(/[™®©]/g, '<sup>$&</sup>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment