diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-30 18:54:39 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-12-05 02:52:36 +0100 |
commit | 042409a2c40bb997739326928eab7d0430cec50b (patch) | |
tree | f7566682a4a75d24dc33924fa7f985c68605558f /src/spans.rs | |
parent | fff865a98aa288930d6e363f03ad57570e429e92 (diff) |
spans: fix spans for quoted attribute values
Diffstat (limited to 'src/spans.rs')
-rw-r--r-- | src/spans.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/spans.rs b/src/spans.rs index ab455f9..6d7c18e 100644 --- a/src/spans.rs +++ b/src/spans.rs @@ -273,9 +273,10 @@ impl<R: GetPos> Emitter<R> for SpanEmitter<R> { )); } - fn init_attribute_value(&mut self, reader: &R) { + fn init_attribute_value(&mut self, reader: &R, quoted: bool) { let current_attr = self.current_attribute.as_mut().unwrap(); - current_attr.1.value_span = reader.get_pos() - 1..reader.get_pos() - 1; + let offset = if quoted { 0 } else { 1 }; + current_attr.1.value_span = reader.get_pos() - offset..reader.get_pos() - offset; } fn push_attribute_name(&mut self, s: &str) { |