File tree 1 file changed +12
-10
lines changed
src/nu/validator/htmlparser/impl
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -3533,14 +3533,14 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3533
3533
}
3534
3534
// XXX reorder point
3535
3535
case AMBIGUOUS_AMPERSAND :
3536
+ /*
3537
+ * Unlike the definition is the spec, we don't consume the
3538
+ * next input character right away when entering this state;
3539
+ * that's because our current implementation differs from
3540
+ * the spec in that we've already consumed the relevant
3541
+ * character *before* entering this state.
3542
+ */
3536
3543
ampersandloop : for (;;) {
3537
- if (reconsume ) {
3538
- if (++pos == endPos ) {
3539
- break stateloop ;
3540
- }
3541
- pos --;
3542
- c = checkChar (buf , pos );
3543
- }
3544
3544
if (c == ';' ) {
3545
3545
errNoNamedCharacterMatch ();
3546
3546
} else if ((c >= '0' && c <= '9' )
@@ -3550,11 +3550,13 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3550
3550
if ((returnState & DATA_AND_RCDATA_MASK ) == 0 ) {
3551
3551
cstart = pos ;
3552
3552
}
3553
- /* The following pos++ is necessary due to how we’ve
3554
- * handled the "reconsume" block for this case. */
3555
- pos ++;
3553
+ if (++pos == endPos ) {
3554
+ break stateloop ;
3555
+ }
3556
+ c = checkChar (buf , pos );
3556
3557
continue ;
3557
3558
}
3559
+ reconsume = true ;
3558
3560
state = transition (state , returnState , reconsume , pos );
3559
3561
continue stateloop ;
3560
3562
}
You can’t perform that action at this time.
0 commit comments