Skip to content

fix: resolve relative image paths in HTML files#890

Merged
Wendong-Fan merged 5 commits intomainfrom
fix-issue-image-render-in-html
Jan 17, 2026
Merged

fix: resolve relative image paths in HTML files#890
Wendong-Fan merged 5 commits intomainfrom
fix-issue-image-render-in-html

Conversation

@4pmtong
Copy link
Copy Markdown
Collaborator

@4pmtong 4pmtong commented Jan 16, 2026

Description

fix #826

  • Add HtmlRenderer component to handle relative image paths in HTML files
  • Convert relative image paths to absolute paths based on HTML file location
  • Load images as data URLs for proper rendering
  • Add DOMPurify for HTML sanitization
  • Preserve original img tag format (self-closing or not)

Fixes issue where images with relative paths (e.g., src="ticket_volume_by_area.png") in HTML files were not rendering correctly.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

- Add HtmlRenderer component to handle relative image paths in HTML files
- Convert relative image paths to absolute paths based on HTML file location
- Load images as data URLs for proper rendering
- Add DOMPurify for HTML sanitization
- Preserve original img tag format (self-closing or not)

Fixes issue where images with relative paths (e.g., src="ticket_volume_by_area.png")
in HTML files were not rendering correctly.
@Wendong-Fan Wendong-Fan merged commit 7fa1640 into main Jan 17, 2026
5 checks passed
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.

[Feature Request] The image failed to render in HTML.

3 participants