diff options
Diffstat (limited to 'src/machine.rs')
-rw-r--r-- | src/machine.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/machine.rs b/src/machine.rs index 5c5c533..f00af0a 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -1359,6 +1359,8 @@ where }, State::DoctypePublicIdentifierDoubleQuoted => match slf.read_char()? { Some('"') => { + slf.emitter + .terminate_doctype_public_id(slf.position_before_match); slf.state = State::AfterDoctypePublicIdentifier; Ok(ControlToken::Continue) } @@ -1368,6 +1370,8 @@ where Ok(ControlToken::Continue) } Some('>') => { + slf.emitter + .terminate_doctype_public_id(slf.position_before_match); slf.emit_error(Error::AbruptDoctypePublicIdentifier); slf.emitter.set_force_quirks(); slf.state = State::Data; @@ -1375,6 +1379,8 @@ where Ok(ControlToken::Continue) } None => { + slf.emitter + .terminate_doctype_public_id(slf.reader.position()); slf.emit_error(Error::EofInDoctype); slf.emitter.set_force_quirks(); slf.emitter.emit_current_doctype(slf.reader.position()); @@ -1387,6 +1393,8 @@ where }, State::DoctypePublicIdentifierSingleQuoted => match slf.read_char()? { Some('\'') => { + slf.emitter + .terminate_doctype_public_id(slf.position_before_match); slf.state = State::AfterDoctypePublicIdentifier; Ok(ControlToken::Continue) } @@ -1396,6 +1404,8 @@ where Ok(ControlToken::Continue) } Some('>') => { + slf.emitter + .terminate_doctype_public_id(slf.position_before_match); slf.emit_error(Error::AbruptDoctypePublicIdentifier); slf.emitter.set_force_quirks(); slf.state = State::Data; @@ -1403,6 +1413,8 @@ where Ok(ControlToken::Continue) } None => { + slf.emitter + .terminate_doctype_public_id(slf.reader.position()); slf.emit_error(Error::EofInDoctype); slf.emitter.set_force_quirks(); slf.emitter.emit_current_doctype(slf.reader.position()); @@ -1553,6 +1565,8 @@ where }, State::DoctypeSystemIdentifierDoubleQuoted => match slf.read_char()? { Some('"') => { + slf.emitter + .terminate_doctype_system_id(slf.position_before_match); slf.state = State::AfterDoctypeSystemIdentifier; Ok(ControlToken::Continue) } @@ -1562,6 +1576,8 @@ where Ok(ControlToken::Continue) } Some('>') => { + slf.emitter + .terminate_doctype_system_id(slf.position_before_match); slf.emit_error(Error::AbruptDoctypeSystemIdentifier); slf.emitter.set_force_quirks(); slf.state = State::Data; @@ -1569,6 +1585,8 @@ where Ok(ControlToken::Continue) } None => { + slf.emitter + .terminate_doctype_system_id(slf.reader.position()); slf.emit_error(Error::EofInDoctype); slf.emitter.set_force_quirks(); slf.emitter.emit_current_doctype(slf.reader.position()); @@ -1581,6 +1599,8 @@ where }, State::DoctypeSystemIdentifierSingleQuoted => match slf.read_char()? { Some('\'') => { + slf.emitter + .terminate_doctype_system_id(slf.position_before_match); slf.state = State::AfterDoctypeSystemIdentifier; Ok(ControlToken::Continue) } @@ -1590,6 +1610,8 @@ where Ok(ControlToken::Continue) } Some('>') => { + slf.emitter + .terminate_doctype_system_id(slf.position_before_match); slf.emit_error(Error::AbruptDoctypeSystemIdentifier); slf.emitter.set_force_quirks(); slf.state = State::Data; @@ -1597,6 +1619,8 @@ where Ok(ControlToken::Continue) } None => { + slf.emitter + .terminate_doctype_system_id(slf.reader.position()); slf.emit_error(Error::EofInDoctype); slf.emitter.set_force_quirks(); slf.emitter.emit_current_doctype(slf.reader.position()); |