… | |
… | |
134 | } |
134 | } |
135 | |
135 | |
136 | sub append_text { |
136 | sub 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 | |
144 | sub _append_text { |
142 | sub _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 | |
166 | sub set_text { |
168 | sub set_text { |
167 | my ($self, $text) = @_; |
169 | my ($self, $text) = @_; |
168 | |
170 | |