Use simpler regular expression to avoid Tcl regsub error (Tcl8.0.4-5).
[tclrobot.git] / robot.tcl
index b49ca0b..2e175d6 100755 (executable)
--- a/robot.tcl
+++ b/robot.tcl
@@ -1,5 +1,5 @@
 #!/usr/bin/tclsh 
-# $Id: robot.tcl,v 1.24 2001/11/07 11:30:52 adam Exp $
+# $Id: robot.tcl,v 1.25 2001/11/07 11:50:07 adam Exp $
 #
 proc RobotFileNext1 {area lead} {
     # puts "RobotFileNext1 area=$area lead=$lead"
@@ -441,8 +441,9 @@ proc RobotTextHtml {url out} {
             }
            puts $out {></meta>}
        } body {
-           regsub -all -nocase {<script([^<]|(<!.*>))*</script>} $body {} abody
-           regsub -all {<[^\>]+>} $abody {} nbody
+           regsub -all {<!--[^-]*->} $body { } abody
+           regsub -all -nocase {<script[^<]*</script>} $abody {} bbody
+           regsub -all {<[^\>]+>} $bbody {} nbody
            puts $out "<documentcontent>"
             puts $out $nbody
             puts $out "</documentcontent>"