<?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: javascript nl2br</title>
	<atom:link href="http://luci.criosweb.ro/blog/2007/07/24/javascript-nl2br/feed/" rel="self" type="application/rss+xml" />
	<link>http://luci.criosweb.ro/blog/2007/07/24/javascript-nl2br/</link>
	<description>Never discourage anyone who continually makes progress</description>
	<lastBuildDate>Mon, 05 Jul 2010 07:06:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Xavi Ivars</title>
		<link>http://luci.criosweb.ro/blog/2007/07/24/javascript-nl2br/comment-page-1/#comment-74889</link>
		<dc:creator>Xavi Ivars</dc:creator>
		<pubDate>Wed, 26 May 2010 19:11:10 +0000</pubDate>
		<guid isPermaLink="false">http://luci.criosweb.ro/blog/?p=51#comment-74889</guid>
		<description>I had to add %0A to the regex in order to replace correctly</description>
		<content:encoded><![CDATA[<p>I had to add %0A to the regex in order to replace correctly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucian Sabo</title>
		<link>http://luci.criosweb.ro/blog/2007/07/24/javascript-nl2br/comment-page-1/#comment-9322</link>
		<dc:creator>Lucian Sabo</dc:creator>
		<pubDate>Fri, 25 Apr 2008 05:47:20 +0000</pubDate>
		<guid isPermaLink="false">http://luci.criosweb.ro/blog/?p=51#comment-9322</guid>
		<description>text.replace takes two arguments: needle and replacement string.
You have deleted the second parameter. I don&#039; know what you intended, but this:
1. probably causes an error
2. doesn&#039;t serves the purpose of nl2br. Nl2Br means replacing new line break (\n,\r\n, \n\r, etc) with the line break HTML tag (br)

So your script in the best scenario will strip all line breaks.</description>
		<content:encoded><![CDATA[<p>text.replace takes two arguments: needle and replacement string.<br />
You have deleted the second parameter. I don&#8217; know what you intended, but this:<br />
1. probably causes an error<br />
2. doesn&#8217;t serves the purpose of nl2br. Nl2Br means replacing new line break (\n,\r\n, \n\r, etc) with the line break HTML tag (br)</p>
<p>So your script in the best scenario will strip all line breaks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rossyny</title>
		<link>http://luci.criosweb.ro/blog/2007/07/24/javascript-nl2br/comment-page-1/#comment-9303</link>
		<dc:creator>rossyny</dc:creator>
		<pubDate>Thu, 24 Apr 2008 21:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://luci.criosweb.ro/blog/?p=51#comment-9303</guid>
		<description>correct me if I&#039;m wrong - the script works better (at least for me) this way though...
&quot;encodeURIComponent&quot;


function nl2br(text){
if(encodeURIComponent){
        text=encodeURIComponent(text);
        return decodeURIComponent(text.replace(/(%5Cr%5Cn)&#124;(%5Cn%5Cr)&#124;%5Cr&#124;%5Cn/g,&#039;&#039;));
        }
else{
        text=escape(text);
        return unescape(text.replace(/(%5Cr%5Cn)&#124;(%5Cn%5Cr)&#124;%5Cr&#124;%5Cn/g,&#039;&#039;));
        }
}</description>
		<content:encoded><![CDATA[<p>correct me if I&#8217;m wrong &#8211; the script works better (at least for me) this way though&#8230;<br />
&#8220;encodeURIComponent&#8221;</p>
<p>function nl2br(text){<br />
if(encodeURIComponent){<br />
        text=encodeURIComponent(text);<br />
        return decodeURIComponent(text.replace(/(%5Cr%5Cn)|(%5Cn%5Cr)|%5Cr|%5Cn/g,&#8221;));<br />
        }<br />
else{<br />
        text=escape(text);<br />
        return unescape(text.replace(/(%5Cr%5Cn)|(%5Cn%5Cr)|%5Cr|%5Cn/g,&#8221;));<br />
        }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
