It now knows what << Prev is, but it may still be confused by other kinds
authoracli <acli>
Thu, 12 Feb 2004 17:38:42 +0000 (17:38 +0000)
committeracli <acli>
Thu, 12 Feb 2004 17:38:42 +0000 (17:38 +0000)
of tag lookalikes

misc/translator/text-extract2.pl

index 8186fdf..274f21f 100755 (executable)
@@ -7,7 +7,8 @@
 
 # This script is meant to be a drop-in replacement of text-extract.pl
 
-# FIXME: Strings like "<< Prev" confuses *this* filter
+# FIXME: Strings like "<< Prev" or "Next >>" may confuse *this* filter
+# TODO: Need to detect unclosed tags, empty tags, and other such stuff.
 
 use Getopt::Long;
 use strict;
@@ -93,7 +94,8 @@ sub next_token_internal (*) {
        ;
     } elsif ($readahead =~ /^\s+/s) {  # whitespace
        ($kind, $it, $readahead) = (KIND_TEXT, $&, $');
-    } elsif ($readahead =~ /^[^<]+/s) {        # non-whitespace normal text
+    # FIXME the following (the [<\s] part) is an unreliable HACK :-(
+    } elsif ($readahead =~ /^(?:[^<]|<[<\s])+/s) {     # non-space normal text
        ($kind, $it, $readahead) = (KIND_TEXT, $&, $');
     } else {                           # tag/declaration/processing instruction
        my $ok_p = 0;