Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@kyoh86
Copy link
Contributor

@kyoh86 kyoh86 commented Jan 27, 2026

Summary

Add a <base> tag so relative paths in rendered HTML (e.g. <img src="./...">) resolve
against the markdown file directory, and rewrite preview asset links to absolute
URLs so they still load correctly.

Background

Markdown has no standardized image sizing syntax; GitHub typically uses HTML
<img> for width/height. Using <base> avoids rewriting HTML in the content.

Changes

  • Insert <base href="..."> into the preview HTML.
  • Convert preview CSS/JS/plantuml links to absolute URLs based on the preview cache dir.
  • Pass the preview base URL to JS so previm-function.js loads correctly.

Notes

This approach affects all relative URLs in the preview document.

fix: #233

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.

HTML <img> relative paths are not resolved in preview

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.