The title says it all, how is it possible to convert all the spaces to non-breaking spaces, following every number of the html, using Javascript?
[edit] I've tried that (source):
Prevent line-breaks after numbers
this.preventBreaks = function(){
/* */
var id = $('.container');
/* edit pattern here */
/* */
var obj = document.getElementById(id);
if(obj){
var html = obj.innerHTML;
var nhtml = html.replace(pattern,function(r){return ""+r+""})
obj.innerHTML = nhtml;
};
};
And a lot of other things messing with
.replace(/(\d+)/g
.
But Javascript is a mystery for me yet.