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.61 -r1.61.2.1 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 13 Feb 2009 11:26:30 -0000 1.61 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 15 May 2009 08:55:19 -0000 1.61.2.1 @@ -284,23 +284,26 @@ # # -gustaf neumann (Jan 2009) - set frag [string map [list &# "&#"] $html_fragment] - if {[catch {dom parse -html $frag doc} errorMsg]} { - # we got an error, so do normal processing - ns_log notice "tdom can't parse the provided HTML, error=$errorMsg,\n\ - checking fragment without tdom" - } else { - $doc documentElement root - set html "" - # discared forms - foreach node [$root selectNodes //form] {$node delete} - # output wellformed html - set b [$root selectNodes {//body[1]}] - foreach n [$b childNodes] { - append html [$n asHTML] + if {$break_soft == 0 && $break_hard == 0} { + set frag [string map [list &# "&#"] $html_fragment] + if {[catch {dom parse -html $frag doc} errorMsg]} { + # we got an error, so do normal processing + ns_log notice "tdom can't parse the provided HTML, error=$errorMsg,\n\ + checking fragment without tdom" + } else { + $doc documentElement root + set html "" + # discared forms + foreach node [$root selectNodes //form] {$node delete} + # output wellformed html + set b [$root selectNodes {//body[1]}] + foreach n [$b childNodes] { + append html [$n asHTML] + } + return $html } - return $html } + set frag $html_fragment # original code continues