Index: openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl,v diff -u -r1.47 -r1.48 --- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 16 Sep 2008 15:07:46 -0000 1.47 +++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 31 Oct 2008 00:50:53 -0000 1.48 @@ -495,6 +495,26 @@ } } + proc ::xowiki::tidy args {eval ::xowiki::Tidy clean $args} + + Object create Tidy + Tidy proc clean {text} { + if {[[::xo::cc package_id] get_parameter tidy 0]} { + set tidycmd [::util::which tidy] + if {$tidycmd ne ""} { + set in_file [ns_tmpnam] + ::xowiki::write_file $in_file $text + catch {exec $tidycmd -q -ashtml < $in_file 2> /dev/null} output + file delete $in_file + #my msg o=$output + regexp \n(.*)\n $output _ output + #my msg o=$output + return $output + } + } + return $text + } + proc copy_parameter {from to} { set parameter_obj [::xo::parameter get_parameter_object \ -parameter_name $from -package_key xowiki] Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.109 -r1.110 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 23 Oct 2008 12:35:48 -0000 1.109 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 31 Oct 2008 00:50:53 -0000 1.110 @@ -296,6 +296,9 @@ if {[info exists page_order] && $page_order ne ""} { set page_order [string trim $page_order " ."] } + #$data set text [::xowiki::tidy [$data set text]]- + foreach {text format} [my var text] break + my var text [list [list [::xowiki::tidy $text] $format]] } WikiForm instproc update_references {} { my instvar data folder_id