aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emitter.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/emitter.rs b/src/emitter.rs
index b47dc20..8f9e56d 100644
--- a/src/emitter.rs
+++ b/src/emitter.rs
@@ -184,7 +184,7 @@ pub struct DefaultEmitter<R, S> {
current_characters: String,
current_token: Option<Token<S>>,
last_start_tag: String,
- current_attribute: Option<(String, String)>,
+ current_attribute: Option<(String, Attribute<S>)>,
seen_attributes: BTreeSet<String>,
emitted_tokens: VecDeque<Token<S>>,
reader: PhantomData<R>,
@@ -220,11 +220,7 @@ impl<R> DefaultEmitter<R, ()> {
.and_modify(|_| {
error = Some(Error::DuplicateAttribute);
})
- .or_insert(Attribute {
- value: v,
- name_span: (),
- value_span: (),
- });
+ .or_insert(v);
if let Some(e) = error {
self.emit_error(e);
@@ -383,13 +379,13 @@ impl<R> Emitter<R> for DefaultEmitter<R, ()> {
fn init_attribute_name(&mut self, _reader: &R) {
self.flush_current_attribute();
- self.current_attribute = Some((String::new(), String::new()));
+ self.current_attribute = Some((String::new(), Attribute::default()));
}
fn push_attribute_name(&mut self, s: &str) {
self.current_attribute.as_mut().unwrap().0.push_str(s);
}
fn push_attribute_value(&mut self, s: &str) {
- self.current_attribute.as_mut().unwrap().1.push_str(s);
+ self.current_attribute.as_mut().unwrap().1.value.push_str(s);
}
fn set_doctype_public_identifier(&mut self, value: &str) {
if let Some(Token::Doctype(Doctype {