<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - coldfusion - 7 - htmldocs - 00000592.htm</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T23:55:28</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#73382" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#73352" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#65253" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#48579" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#48334" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#32400" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#73382">
		<title>coldfusion/7/htmldocs/00000592.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#73382</link>
		<description>The solution suggested by Hoska results in XHTML-compliant code, but puts its output all on one line.&lt;br&gt;The following version puts line breaks to aid source readability.&lt;br&gt;It also puts a line break in if there is a single \r\n.&lt;br&gt;It is arguable whether any of these versions is the &quot;right&quot; solution; I suspect it depends on your circumstances.&lt;br&gt;&lt;br&gt;Finally, note that the example on the page has a bug: the &lt;form&gt; tag needs a method=&quot;POST&quot; attribute.&lt;br&gt;&lt;br&gt;function FormatParagraph(txt) {&lt;br&gt;var temp = ReReplace(Trim(txt), '\r\n\r\n', '&lt;/p&gt;&lt;p&gt;', 'all');&lt;br&gt;temp = '&lt;p&gt;' &amp; ReReplace(temp, '\r\n', '&lt;br /&gt;', 'all') &amp; '&lt;/p&gt;';&lt;br&gt;temp=Replace(temp, '&lt;/p&gt;', '&lt;/p&gt;#Chr(10)##Chr(13)#', 'all');&lt;br&gt;temp=Replace(temp, '&lt;br /&gt;', '&lt;br /&gt;#Chr(10)##Chr(13)#', 'all');&lt;br&gt;return temp;&lt;br&gt;}</description>
		<dc:creator>halL</dc:creator>
		<dc:type>1 0</dc:type>
		<dc:date>2007-09-07T09:57:28</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#73352">
		<title>coldfusion/7/htmldocs/00000592.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#73352</link>
		<description>Cfscript one-liner that does the job:&lt;br /&gt;&lt;br /&gt;function FormatParagraph(txt) { return ('&lt;p&gt;' &amp; ReReplace( ReReplace( &lt;br /&gt;Trim(txt), '\r\n\r\n', '&lt;/p&gt;&lt;p&gt;', 'all'), '\r\n', '&lt;br /&gt;', 'all') &amp; '&lt;/p&gt;'); }</description>
		<dc:creator>Daniel Stockman</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-09-06T16:24:07</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#65253">
		<title>coldfusion/7/htmldocs/00000592.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#65253</link>
		<description>Further, in regards to XHTML, the function only inserts opening &lt;P&gt; tags. There are no closing tags as required by XHTML.&lt;br /&gt;&lt;br /&gt;Why does the function assume that single newlines aren't wanted? I think that single newline characters should be preserved, and replaced with &lt;br /&gt;. Double newlines could be replaced with two &lt;br /&gt; tags. That fixes the XHTML problem.</description>
		<dc:creator>sthompson</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-04-10T10:23:03</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#48579">
		<title>coldfusion/7/htmldocs/00000592.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#48579</link>
		<description>Or you can always wrap ParagraphFormat() in a Replace function to fix the rogue &lt;P&gt; and &lt;/P&gt; instances.</description>
		<dc:creator>rubblemasta</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2006-05-15T08:35:15</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#48334">
		<title>coldfusion/7/htmldocs/00000592.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#48334</link>
		<description>For the &lt;P&gt; problem with XHTML, I used this work-around:  Just replace the result from #paragraphformat(variable)# with #replace(variable, '&lt;P&gt;', '&lt;br&gt;&lt;br&gt;', ALL)#&lt;br /&gt;&lt;br /&gt;This is a hack of a workaround, but it solves the XHTML problem</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2006-05-07T20:26:35</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#32400">
		<title>coldfusion/7/htmldocs/00000592.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/7/htmldocs/00000592.htm#32400</link>
		<description>Note that the ParagraphFormat tag inserts P tags not p tags, note the case. This function is not XHTML safe.</description>
		<dc:creator>pete_freitag</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2005-04-26T13:50:10</dc:date>
	</item>
	</rdf:RDF>

