X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=intl%2FSesse%3A%3AExtractGettext.pm;h=734962f2a8937331391f9ea2149f84c074db9cf6;hb=0daad481aac5b955e3d87aed919fcd43f769882f;hp=857ee1f2a071c6a1858095a13da72bced89deec9;hpb=ce9bde6b8348caeb1637371ad7834a26e3d504c5;p=ccbs diff --git a/intl/Sesse::ExtractGettext.pm b/intl/Sesse::ExtractGettext.pm index 857ee1f..734962f 100644 --- a/intl/Sesse::ExtractGettext.pm +++ b/intl/Sesse::ExtractGettext.pm @@ -9,12 +9,13 @@ our @ISA = qw(Template::Directive); sub textblock { my ($self, $text) = @_; - while ($text =~ s/<(h[1-6]|p|td|th|title|input|span|li|_)[^>]*>(.*?)<\/\1>//s) { - my $text = $2; - $text =~ s/\n/\\n"\n"/g; - $text =~ s/(.)"(?!\n)/$1\\"/g; + while ($text =~ s/<(h[1-6]|p|td|th|title|input|span|li|option|_)[^>]*>(.*?)<\/\1>//s) { + my $id = $2; + next if $id =~ /^\s*$/; + $id =~ s/\n/\\n"\n"/g; + $id =~ s/(.)"(?!\n)/$1\\"/g; - print "msgid \"$text\"\n"; + print "msgid \"$id\"\n"; print "msgstr \"\"\n"; print "\n"; }