149 |
|
|
150 |
|
# ---- In a tag |
151 |
|
if ( $self->{tagcontext}=~/tag/ ) { |
152 |
+ |
$self->{tagbuff}=$self->{tagbuff}.$char; |
153 |
|
if ( ! $self->_quotetest($char) ) { |
154 |
|
if ( ! $self->_labeltest($char) ) { |
155 |
|
if ( $char eq ">") { $self->_closetag(); } |
196 |
|
|
197 |
|
# Do we have an opening or closing tag? |
198 |
|
if ( ($char=$self->_nextchar()) eq "/" ) { #we have a closing tag |
199 |
+ |
$self->{tagbuff}="<".$char; |
200 |
|
$self->{tagcontext}="endtag"; |
201 |
|
} |
202 |
|
else { # an opening tag |
203 |
+ |
$self->{tagbuff}="<"; |
204 |
|
$self->{tagcontext}="starttag"; |
205 |
|
$self->_checkchar($char); |
206 |
|
} |
398 |
|
($self->{tagname}=$self->_getstore())=~tr/A-Z/a-z/; |
399 |
|
} |
400 |
|
else { |
401 |
< |
die ">Tag syntax error in $self->{tagname} on line ". |
402 |
< |
$self->line()." of file \n$self->{filename}"; |
401 |
> |
# do not die anymore - breaks non tag documents |
402 |
> |
#die ">Tag syntax error in $self->{tagname} on line ". |
403 |
> |
# $self->line()." of file \n$self->{filename}"; |
404 |
> |
# -- assume that this is plain text |
405 |
> |
$self->{tagcontext}="text"; |
406 |
> |
$self->_resetstore(); |
407 |
> |
$self->_unshiftstore($self->{tagbuff}); |
408 |
> |
$self->{tagbuff}=""; |
409 |
> |
return; |
410 |
|
} |
411 |
|
} |
412 |
|
$self->_resetstore(); |
422 |
|
$self->{stringbuff}=$self->{stringbuff}.$char; |
423 |
|
} |
424 |
|
|
425 |
+ |
sub _unshiftstore() { |
426 |
+ |
my $self=shift; |
427 |
+ |
my $char=shift; |
428 |
+ |
|
429 |
+ |
$self->{stringbuff}=$char.$self->{stringbuff}; |
430 |
+ |
} |
431 |
+ |
|
432 |
|
sub _getstore() { |
433 |
|
my $self=shift; |
434 |
|
|