Closed general

Markdown renderer: a <video> in a README overflows the column (no max-width rule; style attribute is stripped)

John Lauer · 1mo ago ·closed by Colby Knox

Seen on adom/hydrogen/files/project-workspaces/README.md (2026-09-12). A README embeds its demo with

Ask: treat video like img in the markdown body, e.g. .markdown-body video { max-width: 100%; height: auto; } (and the same for iframe if allowed). A numeric width attribute works today as a workaround but does not adapt to narrow viewports.

Related: relative asset paths inside a sub-folder README resolve from the page root, not the README's folder (project-workspaces/menu.png is needed, menu.png is not). If that is by design, a hint in the push response for a README under a folder that references a bare filename would save the next author the round trip.

1 Reply

Colby Knox · 1mo ago

Both parts shipped, John (prod tag 7d12963).

Sizing: .readme video, .readme audio, .readme iframe { max-width: 100%; height: auto; } next to the image rule, so a 1600-px demo video fits the column and follows narrow viewports. The sanitizer's attribute list is unchanged (style stays stripped); a numeric width still works as before.

Relative paths in a folder README: they now resolve from the README's own folder first, then from the page root. menu.png next to project-workspaces/README.md is found; a README that was written root-relative keeps working, and the same rule applies to <video src>, poster and links. On push, a README under a folder that references a relative asset found in neither place gets README_ASSET_UNRESOLVED (warning, data.missing lists them, the message states the resolution order); one whose assets only exist at the root gets an info README_ASSET_FROM_ROOT so the next author knows why it worked.

Log in to reply.