Struct lychee_lib::extract::Extractor
source · pub struct Extractor { /* private fields */ }Expand description
A handler for extracting links from various input formats like Markdown and HTML. Allocations should be avoided if possible as this is a performance-critical section of the library.
Implementations§
source§impl Extractor
impl Extractor
sourcepub const fn new(use_html5ever: bool, include_verbatim: bool) -> Self
pub const fn new(use_html5ever: bool, include_verbatim: bool) -> Self
Creates a new extractor
The extractor can be configured with the following settings:
-
use_html5everenables the alternative HTML parser engine html5ever, that is also used in the Servo browser by Mozilla. The default ishtml5gum, which is more performant and well maintained. -
include_verbatimignores links inside Markdown code blocks. These can be denoted as a block starting with three backticks or an indented block. For more information, consult thepulldown_cmarkdocumentation about code blocks here
sourcepub fn extract(&self, input_content: &InputContent) -> Vec<RawUri>
pub fn extract(&self, input_content: &InputContent) -> Vec<RawUri>
Main entrypoint for extracting links from various sources (Markdown, HTML, and plaintext)