From c993dfb0c071d5015d019ffa94b438214a842975 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 28 Aug 2023 19:49:51 +0200 Subject: feat: make DefaultEmitter public again --- CHANGELOG.md | 4 ++++ src/emitter.rs | 7 ++++--- src/lib.rs | 5 +---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a401bfe..c7b0dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ * `BufReadReader` can now operate on any `std::io::Read` implementation and no longer requires the reader to implement `std::io::BufRead`. +* The `DefaultEmitter` is now public again. + (Since `adjusted_current_node_present_and_not_in_html_namespace` has been removed, + the DefaultEmitter is now spec-compliant and can be exposed in good conscience.) + #### Breaking changes * Iterating over `Tokenizer` now yields values of a new `Event` enum. diff --git a/src/emitter.rs b/src/emitter.rs index dee0aa0..b75334a 100644 --- a/src/emitter.rs +++ b/src/emitter.rs @@ -158,13 +158,14 @@ pub trait Emitter { fn push_doctype_system_id(&mut self, s: &str); } -/// The DefaultEmitter is not exposed in the public API because: +/// The default implementation of [`Emitter`], used to produce tokens. +/// +/// # Warning /// /// * Using the DefaultEmitter without calling [`Tokenizer::set_state`] /// results in wrong state transitions: /// -#[cfg_attr(not(feature = "integration-tests"), doc = "```ignore")] -#[cfg_attr(feature = "integration-tests", doc = "```")] +/// ``` /// # use html5tokenizer::{DefaultEmitter, Event, Tokenizer, Token}; /// let emitter = DefaultEmitter::default(); /// let html = "