View | Details | Raw Unified | Return to bug 8937
Collapse All | Expand All

(-)a/C4/TTParser.pm (+10 lines)
Lines 60-65 sub build_tokens{ Link Here
60
    $self->handler(end => "end", "self, line, tag, attr, text"); #signature is end( self, linenumber, tagename, original text )
60
    $self->handler(end => "end", "self, line, tag, attr, text"); #signature is end( self, linenumber, tagename, original text )
61
    $self->handler(declaration => "declaration", "self, line, text, is_cdata"); # declaration
61
    $self->handler(declaration => "declaration", "self, line, text, is_cdata"); # declaration
62
    $self->handler(comment => "comment", "self, line, text, is_cdata"); # comments
62
    $self->handler(comment => "comment", "self, line, text, is_cdata"); # comments
63
    $self->handler(process => "process", "self, line, text, is_cdata"); # processing statement <?...?>
63
#    $self->handler(default => "default", "self, line, text, is_cdata"); # anything else
64
#    $self->handler(default => "default", "self, line, text, is_cdata"); # anything else
64
    $self->marked_sections(1); #treat anything inside CDATA tags as text, should really make it a C4::TmplTokenType::CDATA
65
    $self->marked_sections(1); #treat anything inside CDATA tags as text, should really make it a C4::TmplTokenType::CDATA
65
    $self->unbroken_text(1); #make contiguous whitespace into a single token (can span multiple lines)
66
    $self->unbroken_text(1); #make contiguous whitespace into a single token (can span multiple lines)
Lines 116-121 sub comment { Link Here
116
    push @tokens, $t;  
117
    push @tokens, $t;  
117
}      
118
}      
118
119
120
sub process {
121
    my $self = shift;
122
    my $line = shift;
123
    my $work = shift; #original text
124
    my $is_cdata = shift;
125
    my $t = C4::TmplToken->new( $work, ($is_cdata? C4::TmplTokenType::CDATA : C4::TmplTokenType::TEXT), $line, $self->{filename} );
126
    push @tokens, $t;
127
}
128
119
sub default {
129
sub default {
120
    my $self = shift;
130
    my $self = shift;
121
    my $line = shift;
131
    my $line = shift;
(-)a/misc/translator/xgettext.pl (-1 / +1 lines)
Lines 44-49 sub string_negligible_p { Link Here
44
	    || $t =~ /^[A-Za-z]$/		# single letters
44
	    || $t =~ /^[A-Za-z]$/		# single letters
45
            || $t =~ /^(&[a-z]+;|&#\d+;|&#x[0-9a-fA-F]+;|%%|%s|\s|[[:punct:]])*$/ # html entities,placeholder,punct, ...
45
            || $t =~ /^(&[a-z]+;|&#\d+;|&#x[0-9a-fA-F]+;|%%|%s|\s|[[:punct:]])*$/ # html entities,placeholder,punct, ...
46
        || ( $t =~ /^\[\%.*\%\]$/ and $t !~ /\%\].*\[\%/ )    # pure TT entities
46
        || ( $t =~ /^\[\%.*\%\]$/ and $t !~ /\%\].*\[\%/ )    # pure TT entities
47
        || $t =~ /^\s*<\?.*\?>/                               # ignore xml prolog
47
	)
48
	)
48
}
49
}
49
50
50
- 

Return to bug 8937