You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preview does not render embedded images (YouTube thumbnails) and escapes raw HTML #10
Notes containing image embeds do not render in the preview:
Raw HTML in note content (the common YouTube thumbnail pattern: an <a> wrapping an <img src="http://img.youtube.com/vi/ID/0.jpg">) is escaped and shown as literal text, because the markdown renderer runs with html: false.
Even when rendered, the host CSP restricts img-src to 'self' plus a small allowlist, so external images are blocked.
Proposed fix
Backend: signed image proxy (HMAC-SHA256 with a per-instance secret, disk cache, size cap, SSRF-guarded transport) exposing:
GET /img?u=<url>&t=<sig> public (the <img> tag carries no auth headers)
POST /img/sign authenticated, returns proxied URLs for a batch of image URLs
Frontend: render preview with raw HTML enabled but sanitized through DOMPurify; rewrite external image URLs to their signed proxied version before rendering; open links in a new tab.
Note content itself stays untouched (original URLs remain editable); rewriting happens at render time only.
Embedded video players (iframes) remain impossible under the host CSP; the thumbnail-link pattern is the supported outcome.
Activity