WPIntell

Source evidence

Colouring problem

Widon't Part Deux 路 support 路 2013-10-18T04:34:00+00:00

mixedsentiment
mediumseverity
0.66relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 34 rows with source links

14.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Vikestart resolved
Hey, I love your plugin 馃檪 But there is one problem If the last word is assigned a colour, it will end up as a widow without colour. This is because the plugin inserts inside the <span> like this: <span style="color: #00ff00;"> and breaks the CSS. Is there a way you can make it ignore those span tags? http://wordpress.org/plugins/widont-part-deux/ I鈥檒l take a look at this. It鈥檚 a pretty basic reffed, but I can probably extend it to insert the nbsp before any tag. I think I found a solution 馃檪 $(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 style="color: ').replace(/(\d),\s/g, '$1,').replace('<span style="color: ', '<span style="color: '); } }); }); It inserts a non-breaking space in those tags before it attempts to insert a non-breaking space between the two latest words, it then avoids putting that inside the tag. Afterwards, the script removes the non-breaking spaces from the inside of the tag. 馃檪 Turns out this was an issue that affected all tags that contain attributes, not just this case. Version 1.3.1 has been released that should fix this across all tags.

Comments

3 shown
Morgan Estes 2013-10-25T02:59:00+00:00

I鈥檒l take a look at this. It鈥檚 a pretty basic reffed, but I can probably extend it to insert the nbsp before any tag.

Vikestart 2013-10-25T03:14:00+00:00

I think I found a solution 馃檪 $(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 style="color: ').replace(/(\d),\s/g, '$1,').replace('<span style="color: ', '<span style="color: '); } }); }); It inserts a non-breaking space in those tags before it attempts to insert a non-breaking space between the two latest words, it then avoids putting that inside the tag. Afterwards, the script removes the non-breaking spaces from the inside of the tag. 馃檪

Morgan Estes 2014-01-08T03:52:00+00:00

Turns out this was an issue that affected all tags that contain attributes, not just this case. Version 1.3.1 has been released that should fix this across all tags.