ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/kgsueme/superchat.pl
(Generate patch)

Comparing kgsueme/kgsueme/superchat.pl (file contents):
Revision 1.4 by pcg, Fri May 21 16:13:41 2004 UTC vs.
Revision 1.5 by pcg, Sun May 23 02:13:29 2004 UTC

134} 134}
135 135
136sub append_text { 136sub append_text {
137 my ($self, $text) = @_; 137 my ($self, $text) = @_;
138 138
139 my $at_end = $self->at_end;
140 $self->_append_text ($self->{end}, $text); 139 $self->_append_text ($self->{end}, $text);
141 $self->set_end if $at_end;
142} 140}
143 141
144sub _append_text { 142sub _append_text {
145 my ($self, $mark, $text) = @_; 143 my ($self, $mark, $text) = @_;
144
145 my $at_end = $self->at_end;
146 146
147 $text = "<default>$text</default>"; 147 $text = "<default>$text</default>";
148 148
149 my @tag; 149 my @tag;
150 # pseudo-simplistic-xml-parser 150 # pseudo-simplistic-xml-parser
159 159
160 $text =~ /\G([^<]*)/gc or last; 160 $text =~ /\G([^<]*)/gc or last;
161 $self->{buffer}->insert_with_tags_by_name ($self->{buffer}->get_iter_at_mark ($mark), util::xmlto $1, @tag) 161 $self->{buffer}->insert_with_tags_by_name ($self->{buffer}->get_iter_at_mark ($mark), util::xmlto $1, @tag)
162 if length $1; 162 if length $1;
163 } 163 }
164
165 $self->set_end if $at_end;
164} 166}
165 167
166sub set_text { 168sub set_text {
167 my ($self, $text) = @_; 169 my ($self, $text) = @_;
168 170

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines