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]