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 -N -r1.67.2.3 -r1.67.2.4 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 26 Sep 2015 11:25:23 -0000 1.67.2.3 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 9 Oct 2015 15:35:05 -0000 1.67.2.4 @@ -100,9 +100,11 @@ ü ý þ ÿ ¿ } - for { set i 0 } { $i < [ llength $myChars ] } { incr i } { - set text [ string map "[ lindex $myChars $i ] [ lindex $myHTML $i ]" $text ] + set map {} + foreach ch $mychars entity $myHTML { + lappend map $ch $entity } + set text [string map $map $text] } # Convert line breaks @@ -285,14 +287,14 @@ # -gustaf neumann (Jan 2009) 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,\nchecking fragment without tdom" + #set frag [string map [list &# "&#"] $html_fragment] + if {[catch {dom parse -html $html_fragment doc} errorMsg]} { + # we got an error, so do normal processing + ns_log notice "tdom can't parse the provided HTML, error=$errorMsg,\nchecking fragment without tdom" } else { $doc documentElement root set html "" - # discared forms + # discard forms foreach node [$root selectNodes //form] {$node delete} # output wellformed html set b [lindex [$root selectNodes {//body}] 0] @@ -1552,7 +1554,7 @@ set text [string_truncate -ellipsis $ellipsis -more $more -len $truncate_len -- $text] } } - + return $text }