Codebase list libhtml-parser-perl / e107397
When an attribute occurs use the first one in 'attr' instead of the last one. This is apparently what MSIE and Mozilla do. https://rt.cpan.org/Ticket/Display.html?id=5472 gisle 20 years ago
2 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 /* $Id: hparser.c,v 2.93 2003/10/03 13:09:05 gisle Exp $
0 /* $Id: hparser.c,v 2.94 2004/04/01 11:47:27 gisle Exp $
11 *
22 * Copyright 1999-2002, Gisle Aas
33 * Copyright 1999-2000, Michael A. Chase
413413 sv_lower(aTHX_ attrname);
414414
415415 if (argcode == ARG_ATTR) {
416 if (!hv_store_ent(hv, attrname, attrval, 0)) {
416 if (hv_exists_ent(hv, attrname, 0) ||
417 !hv_store_ent(hv, attrname, attrval, 0)) {
417418 SvREFCNT_dec(attrval);
418419 }
419420 SvREFCNT_dec(attrname);
2929 <tAg aRg="Value" arg="other value"></tAg>
3030 EOT
3131 my $cs = 'S[tAg aRg=Value arg=other value Order: aRg arg]E[tAg]';
32 my $ci = 'S[tag arg=other value Order: arg arg]E[tag]';
32 my $ci = 'S[tag arg=Value Order: arg arg]E[tag]';
3333
3434 $p->parse($html)->eof;
3535 print "not " unless $text eq $cs; print "ok 1\n";
5656 EOT
5757 $p->ignore_tags('ignore');
5858 $cs = 'S[tAg aRg=Value arg=other value Order: aRg arg]E[tAg]S[iGnOrE]';
59 $ci = 'S[tag arg=other value Order: arg arg]E[tag]';
59 $ci = 'S[tag arg=Value Order: arg arg]E[tag]';
6060
6161 $text = "";
6262 $p->case_sensitive(0);