MCPcopy Create free account
hub / github.com/untitaker/hyperlink / flush_old_attribute

Method flush_old_attribute

src/html/parser.rs:180–198  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

178 }
179
180 fn flush_old_attribute(&mut self) {
181 let value = self.buffers.current_attribute_value.as_slice();
182
183 match (
184 self.buffers.current_tag_name.as_slice(),
185 self.buffers.current_attribute_name.as_slice(),
186 ) {
187 (b"link" | b"area" | b"a", b"href") => self.extractor.extract_used_link(value),
188 (b"a", b"name") => self.extractor.extract_anchor_def(value),
189 (b"img" | b"script" | b"iframe", b"src") => self.extractor.extract_used_link(value),
190 (b"img", b"srcset") => self.extractor.extract_used_link_srcset(value),
191 (b"object", b"data") => self.extractor.extract_used_link(value),
192 (_, b"id") => self.extractor.extract_anchor_def(value),
193 _ => (),
194 }
195
196 self.buffers.current_attribute_name.clear();
197 self.buffers.current_attribute_value.clear();
198 }
199}
200
201impl<'a, P, F> Emitter for HyperlinkEmitter<'a, '_, P, F>

Callers 2

emit_current_tagMethod · 0.80
init_attributeMethod · 0.80

Calls 3

extract_used_linkMethod · 0.80
extract_anchor_defMethod · 0.80

Tested by

no test coverage detected