Skip to content

Commit

Permalink
Emit second code points with consumed=0
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 committed Apr 6, 2023
1 parent 9c3ed1b commit 726e9f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/decode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export class EntityDecoder {
/**
* The function that is called when a codepoint is decoded.
*
* For multi-byte named entities, this will be called multiple times,
* with the second codepoint, and the same `consumed` value.
* For multi-byte named entities, this will be called a second time.
* For the second call, `consumed` will be 0.
*
* @param codepoint The decoded codepoint.
* @param consumed The number of bytes consumed by the decoder.
Expand Down Expand Up @@ -415,7 +415,7 @@ export class EntityDecoder {
);
if (valueLength === 3) {
// For multi-byte values, we need to emit the second byte.
this.emitCodePoint(decodeTree[result + 2], consumed);
this.emitCodePoint(decodeTree[result + 2], 0);
}

return consumed;
Expand Down

0 comments on commit 726e9f9

Please sign in to comment.