aboutsummaryrefslogtreecommitdiff
path: root/src/spans.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-30 18:39:22 +0100
committerMartin Fischer <martin@push-f.com>2021-12-05 02:52:36 +0100
commitfff865a98aa288930d6e363f03ad57570e429e92 (patch)
treea0cf87f5cb3eb7d285ea4085a3d322a655b27758 /src/spans.rs
parent76408590349f7f132c1dfeb9db3fb1dea964227c (diff)
spans: support attribute values
Diffstat (limited to 'src/spans.rs')
-rw-r--r--src/spans.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/spans.rs b/src/spans.rs
index 300d659..ab455f9 100644
--- a/src/spans.rs
+++ b/src/spans.rs
@@ -262,7 +262,7 @@ impl<R: GetPos> Emitter<R> for SpanEmitter<R> {
}));
}
- fn init_attribute(&mut self, reader: &R) {
+ fn init_attribute_name(&mut self, reader: &R) {
self.flush_current_attribute();
self.current_attribute = Some((
String::new(),
@@ -272,6 +272,12 @@ impl<R: GetPos> Emitter<R> for SpanEmitter<R> {
},
));
}
+
+ fn init_attribute_value(&mut self, reader: &R) {
+ let current_attr = self.current_attribute.as_mut().unwrap();
+ current_attr.1.value_span = reader.get_pos() - 1..reader.get_pos() - 1;
+ }
+
fn push_attribute_name(&mut self, s: &str) {
let current_attr = self.current_attribute.as_mut().unwrap();
current_attr.0.push_str(s);