Images in cover notes (and comments/issues/PRs) always render full width and there's no way to shrink them like you can on GitHub. It's annoying when you paste a big screenshot and it takes over the whole note.
The reason is on upload we just drop in the plain Blossom URL with no size info (NostrComposer.tsx). The renderer can actually already handle width/height (BlossomImage, MarkdownContent), it's just not wired up. Raw HTML like <img width> is turned off for user content (allowHtml=false, for XSS reasons) so even typing it by hand does nothing, and the preview (CommentContent) drops width/height anyway.
GitHub doesn't have any special syntax for this, you just use a plain HTML tag and type it yourself, like <img src="url" width="300"> or width="50%", and if you only set one the other scales to keep the ratio.
To match that we'd want to allow <img> with src/alt/width/height for user content through a narrow sanitize rule (so we get GitHub behavior without opening up full HTML), run the preview through the same renderer so it matches what gets saved, and on upload insert an actual <img> tag instead of a bare URL so it's editable. We already compute dim on upload so we can pre-fill the real size.
Images in cover notes (and comments/issues/PRs) always render full width and there's no way to shrink them like you can on GitHub. It's annoying when you paste a big screenshot and it takes over the whole note.
The reason is on upload we just drop in the plain Blossom URL with no size info (
NostrComposer.tsx). The renderer can actually already handle width/height (BlossomImage,MarkdownContent), it's just not wired up. Raw HTML like<img width>is turned off for user content (allowHtml=false, for XSS reasons) so even typing it by hand does nothing, and the preview (CommentContent) drops width/height anyway.GitHub doesn't have any special syntax for this, you just use a plain HTML tag and type it yourself, like
<img src="url" width="300">orwidth="50%", and if you only set one the other scales to keep the ratio.To match that we'd want to allow
<img>withsrc/alt/width/heightfor user content through a narrow sanitize rule (so we get GitHub behavior without opening up full HTML), run the preview through the same renderer so it matches what gets saved, and on upload insert an actual<img>tag instead of a bare URL so it's editable. We already computedimon upload so we can pre-fill the real size.