-
-
Save nocodesupplyco/44e4fdc9fcb0e6ee57c38de770987b4d to your computer and use it in GitHub Desktop.
Superscript All Registered(®) Trademark Characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Style all <sup> elements */ | |
sup { | |
position: relative; | |
top: -0.5em; | |
font-size: 0.6em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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