Skip to content

feat: implement MD034 no-bare-urls rule with comprehensive validation#50

Merged
ekropotin merged 2 commits into
developmentfrom
dev
Aug 10, 2025
Merged

feat: implement MD034 no-bare-urls rule with comprehensive validation#50
ekropotin merged 2 commits into
developmentfrom
dev

Conversation

@ekropotin
Copy link
Copy Markdown
Owner

Add complete implementation of MD034 rule that detects bare URLs and email addresses that should be properly formatted with angle brackets or markdown links.

Key Features:

  • Uses linkify crate for robust URL/email detection
  • Handles complex edge cases: mailto: schemes, URLs in link text, code spans
  • Perfect parity with original markdownlint (27/27 violations match)
  • Comprehensive test suite with 16 unit tests including edge cases
  • International domain and email support
  • Single-pass O(n) performance optimized algorithm

Implementation Details:

  • Processes paragraph nodes to find bare URLs within markdown text
  • Excludes properly formatted contexts: , text, code, HTML attributes
  • Enhanced markdown link detection for both link text and targets
  • Sophisticated pattern matching for scheme prefixes (mailto:, ftp:, etc.)

Files Added:

  • crates/quickmark_linter/src/rules/md034.rs (504 lines)
  • docs/rules/md034.md (rule documentation)
  • test-samples/test_md034_*.md (comprehensive test cases)

Dependencies Added:

  • linkify 0.10 for accurate URL/email detection

Progress: 8/48 rules implemented (16.7%)

🤖 Generated with Claude Code

Add complete implementation of MD034 rule that detects bare URLs and email
addresses that should be properly formatted with angle brackets or markdown links.

Key Features:
- Uses linkify crate for robust URL/email detection
- Handles complex edge cases: mailto: schemes, URLs in link text, code spans
- Perfect parity with original markdownlint (27/27 violations match)
- Comprehensive test suite with 16 unit tests including edge cases
- International domain and email support
- Single-pass O(n) performance optimized algorithm

Implementation Details:
- Processes paragraph nodes to find bare URLs within markdown text
- Excludes properly formatted contexts: <url>, [text](url), `code`, HTML attributes
- Enhanced markdown link detection for both link text and targets
- Sophisticated pattern matching for scheme prefixes (mailto:, ftp:, etc.)

Files Added:
- crates/quickmark_linter/src/rules/md034.rs (504 lines)
- docs/rules/md034.md (rule documentation)
- test-samples/test_md034_*.md (comprehensive test cases)

Dependencies Added:
- linkify 0.10 for accurate URL/email detection

Progress: 8/48 rules implemented (16.7%)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ekropotin ekropotin self-assigned this Aug 10, 2025
@ekropotin ekropotin enabled auto-merge (squash) August 10, 2025 20:22
@ekropotin ekropotin merged commit 371f619 into development Aug 10, 2025
3 checks passed
@ekropotin ekropotin deleted the dev branch August 10, 2025 20:25
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.

1 participant