Edge Cases Testing
This article tests various edge cases and special scenarios.
Valid Relative Links (Should Convert)
Basic Relative Links
Links with Query Parameters
- Query string: Article with query
- Multiple params: Multiple params
Links with Anchors
- Simple anchor: To section
- Query and anchor: Both
Complex Paths
- Multiple levels: Deep link
- Parent navigation: Up one level
Invalid Links (Should NOT Convert)
Absolute URLs
Absolute Paths
Non-Markdown Links
- HTML link: HTML file
- PDF link: PDF document
- Image link: Image
- No extension: No ext
Empty or Special Links
Mixed Content
Here’s a paragraph with multiple link types:
- Regular markdown link to Test Article 1
- External link to GitHub
- Code with
.md:./test-article-1.md(should not convert)
Code Blocks (Should NOT Convert)
[This link](./test-article-1.md) is in a code block
const link = './test-article-1.md'
Special Characters in Links
- Spaces: [Article with spaces](./test article 1.md) (if file exists)
- Special chars: Special (if file exists)
- Unicode: Chinese
Expected Plugin Behavior
The plugin should:
- ✅ Convert relative
.mdand.mdxlinks - ✅ Preserve query parameters and anchors
- ✅ Apply slugify based on config
- ❌ Ignore absolute URLs
- ❌ Ignore absolute paths
- ❌ Ignore non-markdown files
- ❌ Ignore links in code blocks
- ❌ Ignore inline code