Subject: | 3.15 with keep_encoding: _parse_start_tag fails parsing attributes |
Hi,
I've found that in latest stable version (3.15, pervious version I've successfully tested was 3.09), the attributes of a node were deleted when keep_encoding option is set and there were several space characters between tag name and first attribute.
Ex:
<tag att="value"> gives $gi='tag' and @atts=() (2 spaces after tagname)
whereas
<tag att="value"> gives $gi='tag' and @atts=() (1 space after tagname)
The suspected "bug" is line 1345 of Twig.pm :
if( $string=~ s{^<\s*($REG_NAME)[\s>/]}{}s)
should be
if( $string=~ s{^<\s*($REG_NAME)(?:\s*|[>/])}{}s)
Hope it helps
Gerald Sedrati-Dinet