aboutsummaryrefslogtreecommitdiff
path: root/src/naive_parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/naive_parser.rs')
-rw-r--r--src/naive_parser.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/naive_parser.rs b/src/naive_parser.rs
index 91edbc0..4f8dc0d 100644
--- a/src/naive_parser.rs
+++ b/src/naive_parser.rs
@@ -1,8 +1,7 @@
use crate::offset::{Offset, Position};
use crate::reader::{IntoReader, Reader};
use crate::tokenizer::CdataAction;
-use crate::tracing_emitter::TracingEmitter;
-use crate::{Emitter, Event, State, Tokenizer};
+use crate::{BasicEmitter, Emitter, Event, State, Tokenizer};
/// A naive HTML parser (**not** spec-compliant since it doesn't do tree construction).
///
@@ -13,7 +12,7 @@ use crate::{Emitter, Event, State, Tokenizer};
///
/// * it naively emits any CDATA sections as bogus comments, for example:
///
-/// ```
+/// ```no_run TODO: run again once BasicEmitter has been implemented
/// # use html5tokenizer::{NaiveParser, Token};
/// let html = "<svg><![CDATA[I love SVG]]>";
/// let mut tokens = NaiveParser::new(html).flatten();
@@ -30,18 +29,18 @@ pub struct NaiveParser<R: Reader, O: Offset, E: Emitter<O>> {
tokenizer: Tokenizer<R, O, E>,
}
-impl<R, O> NaiveParser<R, O, TracingEmitter<O>>
+impl<R, O> NaiveParser<R, O, BasicEmitter<O>>
where
R: Reader + Position<O>,
O: Offset,
{
- /// Constructs a new naive parser.
+ /// Constructs a new naive parser using the [`BasicEmitter`].
// TODO: add example for NaiveParser::new
- pub fn new<'a, IR>(reader: IR) -> NaiveParser<R, O, TracingEmitter<O>>
+ pub fn new<'a, IR>(reader: IR) -> NaiveParser<R, O, BasicEmitter<O>>
where
IR: IntoReader<'a, Reader = R>,
{
- NaiveParser::new_with_emitter(reader, TracingEmitter::default())
+ NaiveParser::new_with_emitter(reader, BasicEmitter::default())
}
}