pub struct ScanOptions {
pub code_rules: CodeRules,
pub skip_html_comments: bool,
pub self_links: bool,
}Expand description
What a body scan counts as a link. ScanOptions::default is what
body_links_spanned and crate::body_links use.
§Examples
use markdown_link::code::CodeRules;
use markdown_link::{ScanOptions, body_links_spanned_with};
let options = ScanOptions {
code_rules: CodeRules::SkillExport,
skip_html_comments: true,
self_links: true,
};
let links = body_links_spanned_with("<!-- [[hidden]] --> [[#Intro]]", &options);
assert_eq!(links.len(), 1);
assert_eq!(links[0].target, "");
assert_eq!(links[0].heading.as_deref(), Some("Intro"));Fields§
§code_rules: CodeRulesWhich rules decide what is code. Links in code are not links.
skip_html_comments: boolSkip links inside HTML comments, <!-- to --> or the end of the
body. Off by default: a comment’s links are found.
self_links: boolRead a wikilink with no target and a # fragment, [[#Heading]] or
[[#^block]], as a link to the note it is written in, with an empty
BodyLink::target. Off by default: such a link is dropped.
Trait Implementations§
Source§impl Clone for ScanOptions
impl Clone for ScanOptions
impl Copy for ScanOptions
Source§impl Debug for ScanOptions
impl Debug for ScanOptions
Source§impl Default for ScanOptions
impl Default for ScanOptions
impl Eq for ScanOptions
Source§impl PartialEq for ScanOptions
impl PartialEq for ScanOptions
impl StructuralPartialEq for ScanOptions
Auto Trait Implementations§
impl Freeze for ScanOptions
impl RefUnwindSafe for ScanOptions
impl Send for ScanOptions
impl Sync for ScanOptions
impl Unpin for ScanOptions
impl UnsafeUnpin for ScanOptions
impl UnwindSafe for ScanOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more