diff --git a/src/Tokenizer.ts b/src/Tokenizer.ts index f4c4acb01..2d12808f7 100644 --- a/src/Tokenizer.ts +++ b/src/Tokenizer.ts @@ -313,8 +313,8 @@ export default class Tokenizer { this.sectionStart = this._index; } else if ( this.decodeEntities && - this.special === Special.None && - c === "&" + c === "&" && + (this.special === Special.None || this.special === Special.Title) ) { if (this._index > this.sectionStart) { this.cbs.ontext(this.getSection()); diff --git a/src/__fixtures__/Events/37-entity-in-title.json b/src/__fixtures__/Events/37-entity-in-title.json new file mode 100644 index 000000000..ea0bb5dc3 --- /dev/null +++ b/src/__fixtures__/Events/37-entity-in-title.json @@ -0,0 +1,22 @@ +{ + "name": "entity in title (#592)", + "html": "