Skip to content

Instantly share code, notes, and snippets.

@JMayfield
Last active October 21, 2020 17:57
Show Gist options
  • Save JMayfield/0c77650392cc09aa3b5d6f0ecf5783d8 to your computer and use it in GitHub Desktop.
Save JMayfield/0c77650392cc09aa3b5d6f0ecf5783d8 to your computer and use it in GitHub Desktop.
Wrap Registered Trademark Symbols in Superscript
var regexp = /[\xAE]/;
$('body :not(script,sup)').contents().filter(function() {
return this.nodeType === 3 && (regexp.test(this.nodeValue));
}).replaceWith(function() {
return this.nodeValue.replace(regexp, '<sup>$&</sup>');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment