Skip to content

Instantly share code, notes, and snippets.

@dkesberg
Created October 20, 2020 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkesberg/fa65e773359f863b4f69fe6dc4a5270d to your computer and use it in GitHub Desktop.
Save dkesberg/fa65e773359f863b4f69fe6dc4a5270d to your computer and use it in GitHub Desktop.
Superscript ®and ®
// superscript ®
$(function() {
$('body :not(script,sup)').contents().filter(function() {
return this.nodeType === 3
}).replaceWith(function() {
return this.nodeValue
.replace(/&reg;/gi, '<sup>&reg;</sup>')
.replace(/®/gi, '<sup>&reg;</sup>');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment