/ Published in: jQuery
URL: http://justinhileman.info/articles/a-jquery-widont-snippet
Expand |
Embed | Plain Text
$('h1,h2,h3,li,p').each( function(){ $(this).html($(this).html().replace(/\s([^\s<] )\s*$/,' $1')); } );
Comments
Subscribe to comments
You need to login to post a comment.

The RegEx in this snippet should be `/\s([^\s
Apparently markdown code escaping doesn't always work? I'll try again.
The RegEx in this snippet should be:
/\s([^\s<]+)\s*$/
not