diff options
author | Martin Fischer <martin@push-f.com> | 2023-08-28 19:49:51 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-09-03 23:00:05 +0200 |
commit | c993dfb0c071d5015d019ffa94b438214a842975 (patch) | |
tree | 4b911b24812b07642d491aaf14b6dd5a9b006b58 /src | |
parent | f31bffb8426f04aaadea911e7c42b130a9ee80a5 (diff) |
feat: make DefaultEmitter public again
Diffstat (limited to 'src')
-rw-r--r-- | src/emitter.rs | 7 | ||||
-rw-r--r-- | src/lib.rs | 5 |
2 files changed, 5 insertions, 7 deletions
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<O> { 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 = "<script><b>"; @@ -17,7 +17,7 @@ pub mod reader; mod tokenizer; mod utils; -pub use emitter::{Comment, Doctype, Emitter, EndTag, StartTag, Token}; +pub use emitter::{Comment, DefaultEmitter, Doctype, Emitter, EndTag, StartTag, Token}; pub use error::Error; pub use naive_parser::NaiveParser; pub use tokenizer::{CdataAction, Event, State, Tokenizer}; @@ -25,9 +25,6 @@ pub use tokenizer::{CdataAction, Event, State, Tokenizer}; #[cfg(feature = "integration-tests")] pub use utils::State as InternalState; -#[cfg(feature = "integration-tests")] -pub use emitter::DefaultEmitter; - /// Relative links in the README.md don't work in rustdoc, so we have to override them. macro_rules! file_url { ($path:literal) => { |