From 33a4d5705aa96ffc8ad6ef732af8de53c1a2e024 Mon Sep 17 00:00:00 2001 From: acli Date: Thu, 12 Feb 2004 17:38:42 +0000 Subject: [PATCH] It now knows what << Prev is, but it may still be confused by other kinds of tag lookalikes --- misc/translator/text-extract2.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index 8186fdf063..274f21f5b9 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -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; -- 2.39.5