Skip to content

mdlinkcheck: only look for markdown links in markdown files - #19938

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/mdlink-markdown
Closed

bagder wants to merge 2 commits into
masterfrom
bagder/mdlink-markdown

Conversation

@bagder

@bagder bagder commented Dec 11, 2025 •

Copy link
Copy Markdown
Member

It finds debug outputs in source code otherwise.

Output the whitelist "warnings" to stderr to better allow us to count URLs with ./mdlinkcheck --dry-run | wc -l.

It finds debug outputs in source code otherwise.

Output the whitelist "warnings" to stderr to better allow us to count
URLs with `./mdlinkcheck | wc -l`.
@bagder bagder added the script label Dec 11, 2025
@bagder
bagder marked this pull request as ready for review December 11, 2025 16:18
@bagder
bagder requested a review from Copilot December 11, 2025 16:18
@bagder

bagder commented Dec 11, 2025

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Comment augment review to trigger a new review at any time.

Comment thread scripts/mdlinkcheck Outdated
return;

# is it a markdown extension?
my $md = ($f =~ /\.md$/);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider making the extension check case-insensitive (e.g., /\.md$/i) so files like README.MD are also scanned. This avoids missing markdown links in repos that use uppercase extensions.

🤖 Was this useful? React with 👍 or 👎

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the mdlinkcheck script to prevent false positives when scanning for broken links. The script now restricts markdown-style link detection ([text](url)) to only markdown files, avoiding the detection of debug output patterns in source code. Additionally, whitelist warnings are redirected to stderr to enable clean URL counting via ./mdlinkcheck | wc -l.

  • Adds markdown file detection to only search for markdown-style links in .md files
  • Redirects whitelist warnings to stderr for cleaner stdout output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder bagder closed this in 2e3687c Dec 11, 2025
@bagder
bagder deleted the bagder/mdlink-markdown branch December 11, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants