Support » Plugin: Widon't Part Deux » Put 3 words on the last line instead of 2

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Morgan Estes

    (@morganestes)

    Thanks for the suggestion. I’m assuming this would only affect the main post content, or would you want the option for titles as well?

    Thread Starter Vikestart

    (@vikestart)

    Just for the main post content. I think I found some kind of solution, also for the other problem with the span tag:

    $(document).ready(function($){
    	$('p').html(function(i, oldHtml) {
    		var html = $(this).html();
    		var split = html.split(' ');
    		if ( (split.length > 1) && (!$(this).find('img').length) ) {
    			return oldHtml.replace('<span style="color: ', '<span&nbsp;style="color:&nbsp;').replace(/(\d),\s/g, '$1,').replace(/\s+([^\s]+)$/g, '&nbsp;$1').replace('<span&nbsp;style="color:&nbsp;', '<span style="color: ');
    		}
    	});
    });
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Put 3 words on the last line instead of 2’ is closed to new replies.