Skip to content

Instantly share code, notes, and snippets.

@johnpmorris
Created May 13, 2016 01:34
Show Gist options
  • Save johnpmorris/57eb5b0ffe9b1b4a7b568730452d5bbc to your computer and use it in GitHub Desktop.
Save johnpmorris/57eb5b0ffe9b1b4a7b568730452d5bbc to your computer and use it in GitHub Desktop.
Replace standard hyphens with non-breaking hyphens.
$('span').each(function() {
var text = $(this).text();
$(this).text(text.replace('-', '‑'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment