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.29 -r1.29.2.1 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 8 Nov 2003 08:30:15 -0000 1.29 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 17 Nov 2003 01:52:14 -0000 1.29.2.1 @@ -1227,20 +1227,53 @@ {-maxlen 70} text } { - Converts a chunk of text from text/html to text/html. - Text to text does nothing, but html to html closes any unclosed html tags (see util_close_html_tags). - Text to html does ad_text_to_html, and html to text does a ad_html_to_text. - See those procs for details. + Converts a chunk of text from a variety of formats to either + text/html or text/plain. - DRB: Modified this to accept mime types (text/plain or text/html). Simplies things when - providing confirmation pages for input destined for the content repository ... +

- @param from specify with html or text what type of text you're providing. - @param to specify what format you want this translated into + Html to html closes any unclosed html tags + (see util_close_html_tags). +

+ + Text to html does ad_text_to_html, and html to text does a + ad_html_to_text. See those procs for details. + +

+ + When text is empty, then an empty string will be returned + regardless of any format. This is especially useful when + displaying content that was created with the richtext widget + and might contain empty values for content and format. + + @param from specify what type of text you're providing. Allowed values: +

+ + @param to specify what format you want this translated into. Allowed values: + + + @param maxlen the maximum line width when generating text/plain + @author Lars Pind (lars@pinds.com) @creation-date 19 July 2000 -} { +} { + # DRB: Modified this to accept mime types (text/plain or + # text/html). Simplies things when providing confirmation pages + # for input destined for the content repository ... + + if { [empty_string_p $text] } { + return "" + } + set valid_froms { text/enhanced text/plain text/fixed-width text/html } set valid_tos { text/plain text/html }