pub struct MD051LinkFragments { /* private fields */ }
Expand description
Rule MD051: Link fragments
See docs/md051.md for full documentation, configuration, and examples.
This rule validates that link anchors (the part after #) exist in the current document. Only applies to internal document links (like #heading), not to external URLs or cross-file links.
Implementations§
Source§impl MD051LinkFragments
impl MD051LinkFragments
pub fn new() -> Self
Sourcepub fn with_anchor_style(style: AnchorStyle) -> Self
pub fn with_anchor_style(style: AnchorStyle) -> Self
Create with specific anchor style
Sourcepub fn heading_to_fragment_github_official(&self, heading: &str) -> String
pub fn heading_to_fragment_github_official(&self, heading: &str) -> String
Fragment generation using GitHub.com’s ACTUAL algorithm (verified against GitHub Gists) This is the exact algorithm discovered by testing against GitHub.com itself, not third-party packages
Sourcepub fn heading_to_fragment_github(&self, heading: &str) -> String
pub fn heading_to_fragment_github(&self, heading: &str) -> String
Fragment generation following GitHub’s official slugger algorithm Uses the exact algorithm from github-slugger npm package used by GitHub.com
Sourcepub fn heading_to_fragment_jekyll_official(&self, heading: &str) -> String
pub fn heading_to_fragment_jekyll_official(&self, heading: &str) -> String
Fragment generation following kramdown GFM’s EXACT algorithm Based on comprehensive testing with kramdown 2.5.1 using official Ruby gems This implementation matches the exact behavior verified through kramdown GFM processing
Trait Implementations§
Source§impl Clone for MD051LinkFragments
impl Clone for MD051LinkFragments
Source§fn clone(&self) -> MD051LinkFragments
fn clone(&self) -> MD051LinkFragments
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for MD051LinkFragments
impl Default for MD051LinkFragments
Source§impl Rule for MD051LinkFragments
impl Rule for MD051LinkFragments
fn name(&self) -> &'static str
fn description(&self) -> &'static str
Source§fn should_skip(&self, ctx: &LintContext<'_>) -> bool
fn should_skip(&self, ctx: &LintContext<'_>) -> bool
fn check(&self, ctx: &LintContext<'_>) -> LintResult
fn fix(&self, ctx: &LintContext<'_>) -> Result<String, LintError>
fn as_any(&self) -> &dyn Any
Source§fn from_config(config: &Config) -> Box<dyn Rule>where
Self: Sized,
fn from_config(config: &Config) -> Box<dyn Rule>where
Self: Sized,
Source§fn default_config_section(&self) -> Option<(String, Value)>
fn default_config_section(&self) -> Option<(String, Value)>
impl Rule for ...
block,
not just the inherent impl.Source§fn check_with_structure(
&self,
ctx: &LintContext<'_>,
_structure: &DocumentStructure,
) -> LintResult
fn check_with_structure( &self, ctx: &LintContext<'_>, _structure: &DocumentStructure, ) -> LintResult
Source§fn check_with_ast(
&self,
ctx: &LintContext<'_>,
_ast: &MarkdownAst,
) -> LintResult
fn check_with_ast( &self, ctx: &LintContext<'_>, _ast: &MarkdownAst, ) -> LintResult
Source§fn check_with_structure_and_ast(
&self,
ctx: &LintContext<'_>,
_structure: &DocumentStructure,
_ast: &MarkdownAst,
) -> LintResult
fn check_with_structure_and_ast( &self, ctx: &LintContext<'_>, _structure: &DocumentStructure, _ast: &MarkdownAst, ) -> LintResult
Source§fn category(&self) -> RuleCategory
fn category(&self) -> RuleCategory
Source§fn uses_document_structure(&self) -> bool
fn uses_document_structure(&self) -> bool
fn as_maybe_document_structure(&self) -> Option<&dyn MaybeDocumentStructure>
fn as_maybe_ast(&self) -> Option<&dyn MaybeAst>
Source§fn config_aliases(&self) -> Option<HashMap<String, String>>
fn config_aliases(&self) -> Option<HashMap<String, String>>
Source§fn fix_capability(&self) -> FixCapability
fn fix_capability(&self) -> FixCapability
Auto Trait Implementations§
impl Freeze for MD051LinkFragments
impl RefUnwindSafe for MD051LinkFragments
impl Send for MD051LinkFragments
impl Sync for MD051LinkFragments
impl Unpin for MD051LinkFragments
impl UnwindSafe for MD051LinkFragments
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more