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.62 --- 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 07:37:17 -0000 1.62 @@ -285,21 +285,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\ + if {$break_soft == 0 && $break_hard == 0} { + # + # Only tag-closing functionality is required + # + 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] + } else { + $doc documentElement root + set html "" + # discard 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