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.
| 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. |
| 39 | struct 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 | |
| 53 | impl<'a, P, F> LinkExtractor<'a, '_, P, F> |
| 54 | where |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…