Skip to content

Fix regular expression for compactability#127

Open
SamarthJ2004 wants to merge 1 commit intoethereum:masterfrom
SamarthJ2004:issue-91
Open

Fix regular expression for compactability#127
SamarthJ2004 wants to merge 1 commit intoethereum:masterfrom
SamarthJ2004:issue-91

Conversation

@SamarthJ2004
Copy link
Copy Markdown

Fix

  • When logging , found that for autolink the link.title is empty . So, added the condition to skip whenever it is empty.
  • Also added a suitable test, with both autolink and Markdown link, to check it prove its proper functionality

Issue Associated #91

Comment on lines +138 to 142
if link.title.is_empty() {
println!("Skipping autolink: {}", link.url);
return Ok(Next::SkipChildren);
}
self.check(ast, &link.title)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this doesn't make sense. If the title is empty, check won't return any matches.

.deny(
"markdown-re",
Regex {
message: "boop",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"boop" doesn't appear in https://example.com, so this test doesn't actually make sure that autolinks aren't checked for matches. You need to make sure that, before your fix, the test fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants