Index: openacs-4/packages/xotcl-core/tcl/ical-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/ical-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xotcl-core/tcl/ical-procs.tcl 2 Dec 2007 21:42:44 -0000 1.1 +++ openacs-4/packages/xotcl-core/tcl/ical-procs.tcl 3 Dec 2007 11:21:15 -0000 1.2 @@ -56,5 +56,22 @@ #my log "$start_date <= $end_date = [expr {[clock scan $start_date] <= [clock scan $end_date]}]" expr {[clock scan $start_date] <= [clock scan $end_date]} } + + ical ad_proc text_to_ical {{-remove_tags false} text} { + Transform arbitrary text to the escaped ical text format + (see rfc 2445) + } { + if {$remove_tags} {regsub -all {<[^>]+>} $text "" text} + regsub -all \n $text \\n text + regsub -all {(\\|\;|\,)} $text {\\\1} text + return $text + } + ical ad_proc ical_to_text {text} { + Transform the escaped ical text format to plain text + } { + regsub -all {\\(n|N)} $text \n text + regsub -all {\\(\\|\;|\,)} $text {\1} text + return $text + } } \ No newline at end of file