Skip to content

Instantly share code, notes, and snippets.

@shrwnsan
Created March 12, 2013 18:34
Show Gist options
  • Save shrwnsan/5145599 to your computer and use it in GitHub Desktop.
Save shrwnsan/5145599 to your computer and use it in GitHub Desktop.
Based on Dan Cederholm's http://simplebits.com/notebook/2008/08/14/ampersands-2/ Crafted this years back to take care of rogue's that the WordPress plugin WP-Typography couldn't take care of, e.g. ampersands, due to priority parsing of the markup.
jQuery(document).ready(function() {
jQuery('#content div.entry div.info h2 a').each(function() {
var new_text = jQuery(this).html().replace(/&amp;/g, '<span class="amp">&amp;</span>');
jQuery(this).html(new_text);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment