<?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>Wed, 08 Feb 2012 13:50:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Tom J Nowell</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-83462</link>
		<dc:creator>Tom J Nowell</dc:creator>
		<pubDate>Fri, 11 Feb 2011 15:54:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-83462</guid>
		<description>Apologies for being a stickler, but these aren&#039;t widows, they&#039;re orphans.

A widow is a line of a paragraph that is too long that gets pushed onto the following page, resulting in a single line at the top of the next page.

An orphan is a single word that is pushed off the end of a line by word wrapping and ends up on its own on the following line.

Again sorry for being a pedant!</description>
		<content:encoded><![CDATA[<p>Apologies for being a stickler, but these aren&#8217;t widows, they&#8217;re orphans.</p>
<p>A widow is a line of a paragraph that is too long that gets pushed onto the following page, resulting in a single line at the top of the next page.</p>
<p>An orphan is a single word that is pushed off the end of a line by word wrapping and ends up on its own on the following line.</p>
<p>Again sorry for being a pedant!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: herostwist</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-82960</link>
		<dc:creator>herostwist</dc:creator>
		<pubDate>Sat, 23 Oct 2010 20:27:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-82960</guid>
		<description>i use .replace(/\s+([^\s]+)\s*/, &#039;&amp;nbdp;$1&#039;) this regex copes with all punctuation and special charcters and also trailing spaces before closing tags.</description>
		<content:encoded><![CDATA[<p>i use .replace(/\s+([^\s]+)\s*/, &#8216;&amp;nbdp;$1&#8242;) this regex copes with all punctuation and special charcters and also trailing spaces before closing tags.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows/comment-page-1#comment-79856</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Wed, 17 Mar 2010 02:05:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/07/three-quick-ways-to-avoid-widows#comment-79856</guid>
		<description>I&#039;ve had some trouble with this script messing with img tags inside p tags. I&#039;ve been using the following to avoid it but its not great because it just ignores paragraphs that have images...

&lt;code&gt;$(&#039;p:not(p:has(img))&#039;).html(function(i,html){
return html.replace(/ (\S+)$/,&#039;&#160;$1&#039;);
});&lt;/code&gt;

but works for most things..
*note* requires jquery 1.4</description>
		<content:encoded><![CDATA[<p>I&#8217;ve had some trouble with this script messing with img tags inside p tags. I&#8217;ve been using the following to avoid it but its not great because it just ignores paragraphs that have images&#8230;</p>
<p><code>$('p:not(p:has(img))').html(function(i,html){<br />
return html.replace(/ (\S+)$/,'&nbsp;$1');<br />
});</code></p>
<p>but works for most things..<br />
*note* requires jquery 1.4</p>
]]></content:encoded>
	</item>
	<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>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 5/19 queries in 0.005 seconds using disk: basic
Object Caching 371/374 objects using disk: basic
Content Delivery Network via learningjquery.kswedberg.netdna-cdn.com

Served from: www.learningjquery.com @ 2012-02-08 17:23:17 -->
