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.24 -r1.25 --- openacs-4/packages/xotcl-core/tcl/ical-procs.tcl 9 May 2022 17:22:45 -0000 1.24 +++ openacs-4/packages/xotcl-core/tcl/ical-procs.tcl 11 Jul 2022 12:45:57 -0000 1.25 @@ -102,6 +102,23 @@ return $text } + :public object method reflow_content_line {text} { + # + # Perform line folding: According to RFC 5545 section 3.1, + # SHOULD NOT be longer than 75 octets, excluding the line break. + # https://www.ietf.org/rfc/rfc5545.txt + # + if {[string length $text] > 73} { + set lines "" + while {[string length $text] > 73} { + append lines [string range $text 0 73] \r\n " " + set text [string range $text 74 end] + } + append lines $text + set text $lines + } + return $text + } } namespace eval ::xo { @@ -184,21 +201,7 @@ } if {$value ne ""} { - set result "$tag:$value" - # - # Perform line folding: According to RFC 5545 section 3.1, - # SHOULD NOT be longer than 75 octets, excluding the line break. - # https://www.ietf.org/rfc/rfc5545.txt - # - if {[string length $result] > 73} { - set lines "" - while {[string length $result] > 73} { - append lines [string range $result 0 73] \r\n " " - set result [string range $result 74 end] - } - append lines $result - set result $lines - } + set result [::xo::ical reflow_content_line "$tag:$value"] append result \r\n #ns_log notice "::xo::ical::VCALITEM tag [self args] -> len: [string length $result]" } else {