avancement planning
This commit is contained in:
+9
-2
@@ -577,15 +577,22 @@ export default class Tokenizer {
|
||||
: DecodingMode.Attribute);
|
||||
}
|
||||
stateInEntity() {
|
||||
const length = this.entityDecoder.write(this.buffer, this.index - this.offset);
|
||||
const indexInBuffer = this.index - this.offset;
|
||||
const length = this.entityDecoder.write(this.buffer, indexInBuffer);
|
||||
// If `length` is positive, we are done with the entity.
|
||||
if (length >= 0) {
|
||||
this.state = this.baseState;
|
||||
if (length === 0) {
|
||||
this.index = this.entityStart;
|
||||
this.index -= 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (indexInBuffer < this.buffer.length &&
|
||||
this.buffer.charCodeAt(indexInBuffer) === CharCodes.Amp) {
|
||||
this.state = this.baseState;
|
||||
this.index -= 1;
|
||||
return;
|
||||
}
|
||||
// Mark buffer as consumed.
|
||||
this.index = this.offset + this.buffer.length - 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user