Skip to content

Commit

Permalink
regex file modification
Browse files Browse the repository at this point in the history
  • Loading branch information
IjayAbby committed Oct 23, 2024
1 parent 4d718e2 commit d2ad8d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion eipw-lint/src/lints/markdown/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ impl<'a, 'b, 'c> tree::Visitor for ExcludesVisitor<'a, 'b, 'c> {
}

fn enter_link(&mut self, ast: &Ast, link: &NodeLink) -> Result<Next, Self::Error> {
self.check(ast, &link.title)
// Skip the check if the link is an autolink
if link.url.starts_with('<') && link.url.ends_with('>') {
return Ok(Next::TraverseChildren);
}
// For regular links, check both title and URL
self.check(ast, &link.title)?;
self.check(ast, &link.url)
}

fn enter_image(&mut self, ast: &Ast, link: &NodeLink) -> Result<Next, Self::Error> {
Expand Down

0 comments on commit d2ad8d9

Please sign in to comment.