Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.9.2.5 -r1.9.2.6 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 5 Mar 2003 14:40:42 -0000 1.9.2.5 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 26 Mar 2003 15:58:57 -0000 1.9.2.6 @@ -18,6 +18,7 @@ -no_links:boolean -no_lines:boolean -no_quote:boolean + -includes_html:boolean text } { Converts plaintext to html. Also translates any recognized @@ -71,7 +72,7 @@ # Convert line breaks if { !$no_lines_p } { - set text [util_convert_line_breaks_to_html $text] + set text [util_convert_line_breaks_to_html -includes_html=$includes_html_p -- $text] } if { !$no_quote_p } { @@ -103,6 +104,7 @@ } ad_proc -public util_convert_line_breaks_to_html { + {-includes_html:boolean} text } { Convert line breaks to
and
tags, respectively.
@@ -115,8 +117,10 @@
regsub -all {\r\n} $text "\n" text
regsub -all {\r} $text "\n" text
- # Remove whitespace around \n's
- regsub -all {\s+\n\s+} $text "\n" text
+ # Remove whitespace before \n's
+ regsub -all {[ \t]*\n} $text "\n" text
+
+
# Wrap P's around paragraphs
set text "
$text
" @@ -125,6 +129,14 @@ # Convert _single_ CRLF's to