avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+12 -5
View File
@@ -635,19 +635,26 @@ export default class Tokenizer {
}
private stateInEntity(): void {
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;
}