Skip to content

Instantly share code, notes, and snippets.

@ryandemmer
Created October 27, 2020 11:43
Show Gist options
  • Save ryandemmer/18714ea584a7f63b527503038823fa30 to your computer and use it in GitHub Desktop.
Save ryandemmer/18714ea584a7f63b527503038823fa30 to your computer and use it in GitHub Desktop.
Convert spaces before colon to non-breaking
(function() {
tinyMCE.onAddEditor.add(function (mgr, ed) {
ed.onSetContent.add(function(ed, o) {
o.content = o.content.replace(/\s:/g, ' :');
});
ed.onGetContent.add(function(ed, o) {
o.content = o.content.replace(/\s:/g, ' :');
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment