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

Class LinkExtractor

src/html/parser.rs:39–51  ·  view source on GitHub ↗

Turns attribute values into links and emits them through the callback, keeping track of which paragraph they belong to. This lives in its own struct (disjoint from the tag/attribute buffers in HyperlinkEmitter) so that links can be pushed while attribute values are still borrowed.

Source from the content-addressed store, hash-verified

37/// This lives in its own struct (disjoint from the tag/attribute buffers in HyperlinkEmitter) so
38/// that links can be pushed while attribute values are still borrowed.
39struct LinkExtractor<'a, 'd, P: ParagraphWalker, F> {
40 paragraph_walker: P,
41 arena: &'a Bump,
42 document: &'d Document,
43 /// Buffers the links of the currently open paragraph, see push_link. Lent out by
44 /// DocumentBuffers so the allocation is reused across documents. Buffered links have no
45 /// paragraph yet, it is attached in flush_links.
46 link_buf: &'d mut Vec<Link<'a, VoidParagraph>>,
47 scratch: &'d mut String,
48 in_paragraph: bool,
49 check_anchors: bool,
50 callback: F,
51}
52
53impl<'a, P, F> LinkExtractor<'a, '_, P, F>
54where

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…