Skip to content

Conversation

rochacbruno
Copy link
Owner

Summary

Fixes relative links to media files being incorrectly converted to HTML links.

  • Media file links like [View Image](/media/image.webp) are now preserved correctly
  • Internal page links like [About](about.md) still convert to about.html as expected
  • Comprehensive media file format support including images, videos, audio, documents, and archives

Changes

  • Added media file extension detection to fix_internal_links() function in src/parser.rs
  • Skip HTML conversion for links ending with media file extensions
  • Added comprehensive test coverage for media file link preservation
  • Preserved existing behavior for internal page links

Test Plan

Testing

The fix was tested with the exact scenario from the issue:

[\![MikroTik Hap ac2](/media/thumbs/homecloudpart1-mikrotik.webp)](/media/homecloudpart1-mikrotik.webp)

Before: Generated incorrect link media-homecloudpart1-mikrotik-webp.html
After: Preserves correct link /media/homecloudpart1-mikrotik.webp

Closes #281

🤖 Generated with Claude Code

- Add media file extension detection to fix_internal_links function
- Skip HTML conversion for links ending with media file extensions
- Support comprehensive list of media formats: images, videos, audio, documents, and archives
- Add comprehensive test coverage for media file link preservation
- Preserve existing behavior for internal page links

Fixes #281

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

Co-Authored-By: Claude <noreply@anthropic.com>
@rochacbruno rochacbruno merged commit 50dc772 into main Jul 18, 2025
3 checks passed
@rochacbruno rochacbruno deleted the feat/281 branch July 18, 2025 19:10
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.

Relative links to "media" turn into html link
1 participant