Commit 371f619
feat: implement MD034 no-bare-urls rule with comprehensive validation (#50)
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>1 parent 9cafa36 commit 371f619
11 files changed
Lines changed: 837 additions & 5 deletions
File tree
- .github/workflows
- crates
- quickmark_config/src
- quickmark_linter
- src/rules
- docs/rules
- test-samples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| |||
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
346 | 351 | | |
347 | 352 | | |
348 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments