Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 17 Jul 2007 13:18:08 -0000 1.22 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 18 Jul 2007 10:49:33 -0000 1.23 @@ -331,7 +331,7 @@ if {$value eq $v} {return [my localize $label]} } } - return [string map [list & "&" < "<" > ">" \" """ ' "'"] $v] + return [string map [list & "&" < "<" > ">" \" """ ' "'" @ "@"] $v] } ########################################################### @@ -487,8 +487,8 @@ } } FormField::richtext instproc pretty_value {v} { - # for richtext, perform no output escaping - return $v + # for richtext, perform minimal output escaping + return [string map [list @ "@"] $v] } ########################################################### Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.80 -r1.81 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 17 Jul 2007 13:18:08 -0000 1.80 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 18 Jul 2007 10:49:33 -0000 1.81 @@ -713,14 +713,19 @@ } - - set form [my regsub_eval \ - [template::adp_variable_regexp] $form \ - {my form_field_as_html "\\\1" "\2" $form_fields}] + # the following command wout be correct, but does not work due to a bug in + # tdom. + #set form [my regsub_eval \ + # [template::adp_variable_regexp] $form \ + # {my form_field_as_html "\\\1" "\2" $form_fields}] + # due to this bug, we postone the replacement after parseing. + # TODO maybe we have to have a better escape mechanism for at characters. either in values or in the template + set form [string map [list @ \x003] $form] #my msg form=$form dom parse -simple -html $form doc $doc documentElement root + ::require_html_procs $root firstChild fcn # @@ -738,7 +743,6 @@ $f render_item } } $fcn - # # append some fields after the HTML contents of the form # @@ -771,8 +775,14 @@ $form setAttribute class [string trim "$oldCSSClass margin-form"] } my set_form_data - set result [$root asHTML] - my view $result + set html [$root asHTML] + + set html [my regsub_eval \ + {(^|[^\\])\x003([a-zA-Z0-9_:]+)\x003} $html \ + {my form_field_as_html "\\\1" "\2" $form_fields}] + + #my msg result=$html + my view $html }