Index: openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl,v diff -u -N -r1.45 -r1.46 --- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 30 Apr 2018 08:47:40 -0000 1.45 +++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 22 Oct 2018 19:44:23 -0000 1.46 @@ -41,6 +41,14 @@ switch [dict get $d mime] { text/html { set content [dict get $d html] + try { + dom parse -simple -html $content doc + $doc documentElement root + foreach n [$root selectNodes {//script|//noscript|//nav|//button}] {$n delete} + set content [$root asHTML] + } on error {errorMsg} { + ns_log notice "xowiki::datasource: could not parse result of search_render for page $page: $errorMsg" + } # # The function ad_html_text_convert can take forever on largish # files, when e.g. someone loads a huge plain/text file into an @@ -54,7 +62,7 @@ set text [ad_html_text_convert -from text/html -to text/plain -- [dict get $d html]] #set text [ad_text_to_html -- [dict get $d html]]; #this could be used for entity encoded html text in rss entries } - + # If the html contains links (which are rendered by ad_html_text as [1], [2], ...) # then we have to use CDATA in the description # @@ -86,7 +94,7 @@ if {[::xo::db::require exists_table txt]} { ::xo::dc dml delete_old_revisions { delete from txt where object_id in \ - (select revision_id from cr_revisions + (select revision_id from cr_revisions where item_id = :item_id and revision_id != :revision_id) } } @@ -180,7 +188,7 @@ } } -::xo::library source_dependent +::xo::library source_dependent # # Local variables: