<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Three Quick Ways to Avoid Widows</title>
	<atom:link href="http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Tue, 16 Mar 2010 15:31:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jQuery &#8212; Toutes les femmes sont folles &#124; de Q &#124; 10 + -- css 4 design</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-79304</link>
		<dc:creator>jQuery &#8212; Toutes les femmes sont folles &#124; de Q &#124; 10 + -- css 4 design</dc:creator>
		<pubDate>Sun, 06 Dec 2009 23:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-79304</guid>
		<description>[...] site Learning jQuery propose trois méthodes pour appliquer un espace insécable &#160; entre les deux derniers mots d&#8217;un titre pour [...]</description>
		<content:encoded><![CDATA[<p>[...] site Learning jQuery propose trois méthodes pour appliquer un espace insécable &nbsp; entre les deux derniers mots d&#8217;un titre pour [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DLF (Dark LIfeform)</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-77807</link>
		<dc:creator>DLF (Dark LIfeform)</dc:creator>
		<pubDate>Tue, 07 Jul 2009 13:20:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-77807</guid>
		<description>Thanks for the great article.  It really helped me in one of my projects.</description>
		<content:encoded><![CDATA[<p>Thanks for the great article.  It really helped me in one of my projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jhoysi</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-77483</link>
		<dc:creator>jhoysi</dc:creator>
		<pubDate>Tue, 16 Jun 2009 14:44:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-77483</guid>
		<description>Oh, I&#039;m so happy this was pointed out! I was just getting worried that all my links were becoming plain text when I implemented this, but this little change solved it all! 

Great script, thanks! =)</description>
		<content:encoded><![CDATA[<p>Oh, I&#8217;m so happy this was pointed out! I was just getting worried that all my links were becoming plain text when I implemented this, but this little change solved it all! </p>
<p>Great script, thanks! =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maverick &#187; Come correggere gli &#8220;a capo&#8221; con jQuery</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-64017</link>
		<dc:creator>Maverick &#187; Come correggere gli &#8220;a capo&#8221; con jQuery</dc:creator>
		<pubDate>Sun, 25 Jan 2009 21:55:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-64017</guid>
		<description>[...] Nel mio caso ho trovato molto utile questo articolo: http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows [...]</description>
		<content:encoded><![CDATA[<p>[...] Nel mio caso ho trovato molto utile questo articolo: <a href="http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows" rel="nofollow">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-53522</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 19 Aug 2008 21:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-53522</guid>
		<description>I just noticed that this does not work if the last word is a link. 

Does anyone know how to fix that?</description>
		<content:encoded><![CDATA[<p>I just noticed that this does not work if the last word is a link. </p>
<p>Does anyone know how to fix that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-53161</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Wed, 13 Aug 2008 14:51:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-53161</guid>
		<description>Hi Andrew,

A quick way to do that with a regular expression would be :
&lt;pre&gt;&lt;code&gt;
$(&#039;p.someclass&#039;).each(function() {
  var original = $(this).html();
  $(this).html( original.replace(/-/g, &#039;&#8212;&#039;) );
});
&lt;/code&gt;&lt;/pre&gt;
Keep in mind, though, that this will mess up IDs or class names that have hyphens in them, if they&#039;re in those paragraphs. I don&#039;t have time to work out how to avoid that at the moment, but if someone else would like to give it a shot, go for it. :)</description>
		<content:encoded><![CDATA[<p>Hi Andrew,</p>
<p>A quick way to do that with a regular expression would be :</p>
<pre><code>
$('p.someclass').each(function() {
  var original = $(this).html();
  $(this).html( original.replace(/-/g, '&mdash;') );
});
</code></pre>
<p>Keep in mind, though, that this will mess up IDs or class names that have hyphens in them, if they&#8217;re in those paragraphs. I don&#8217;t have time to work out how to avoid that at the moment, but if someone else would like to give it a shot, go for it. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-53141</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 13 Aug 2008 02:02:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-53141</guid>
		<description>This is a great tip! I am glad that I found this....

What if I wanted to change all hyphens to em dashes? And better yet in a specified paragraph class?

Is this possible? How would you do that?</description>
		<content:encoded><![CDATA[<p>This is a great tip! I am glad that I found this&#8230;.</p>
<p>What if I wanted to change all hyphens to em dashes? And better yet in a specified paragraph class?</p>
<p>Is this possible? How would you do that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MarcusT</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-52396</link>
		<dc:creator>MarcusT</dc:creator>
		<pubDate>Thu, 31 Jul 2008 03:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-52396</guid>
		<description>Presenting three different ways to do it is certainly a good way to get people switched on to how best to tackle something, but surely each incurs a different performance hit?

My money&#039;s on the second (string-based) method as the best performing approach, but it would be helpful to provide benchmark results in your post so that each solution&#039;s performance can be taken into account...

And I wonder what the best way would be of ensuring that if any of the three approaches are accidentally (or intentionally) run multiple times the changes are not reapplied each time, resulting in new lines of 3,4,5,etc words...?</description>
		<content:encoded><![CDATA[<p>Presenting three different ways to do it is certainly a good way to get people switched on to how best to tackle something, but surely each incurs a different performance hit?</p>
<p>My money&#8217;s on the second (string-based) method as the best performing approach, but it would be helpful to provide benchmark results in your post so that each solution&#8217;s performance can be taken into account&#8230;</p>
<p>And I wonder what the best way would be of ensuring that if any of the three approaches are accidentally (or intentionally) run multiple times the changes are not reapplied each time, resulting in new lines of 3,4,5,etc words&#8230;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dylan Hafertepen</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-51793</link>
		<dc:creator>Dylan Hafertepen</dc:creator>
		<pubDate>Tue, 22 Jul 2008 00:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-51793</guid>
		<description>Why not use CSS property &lt;code&gt;white-space: nowrap;&lt;/code&gt;?

&lt;pre&gt;&lt;code&gt;
  $(&#039;h2&#039;).each(function() {
    var h2Contents = $(this).html().split(&quot; &quot;);
    h2Contents[h2Contents.length-2] = &#039;&lt;span style=&quot;white-space: nowrap; color: red;&quot;&gt;&#039; + h2Contents[h2Contents.length-2];
    h2Contents[h2Contents.length-1] = h2Contents[h2Contents.length-1] + &#039;&lt;/span&gt;&#039;;
    $(this).html(h2Contents.join(&#039; &#039;));
  });
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Why not use CSS property <code>white-space: nowrap;</code>?</p>
<pre><code>
  $('h2').each(function() {
    var h2Contents = $(this).html().split(" ");
    h2Contents[h2Contents.length-2] = '&lt;span style="white-space: nowrap; color: red;"&gt;' + h2Contents[h2Contents.length-2];
    h2Contents[h2Contents.length-1] = h2Contents[h2Contents.length-1] + '&lt;/span&gt;';
    $(this).html(h2Contents.join(' '));
  });
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-51470</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 17 Jul 2008 19:42:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-51470</guid>
		<description>jQuery rocks! Thanks for the great articles!</description>
		<content:encoded><![CDATA[<p>jQuery rocks! Thanks for the great articles!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
