mirror of
https://github.com/outline/outline.git
synced 2026-11-23 06:11:04 +03:00
Images with a stored pixel width (e.g. from paste) set an inline style="width: 1920px" on the image-wrapper and img elements. In tables without explicit colwidth attributes the browser uses table-layout: auto, which lets cells expand to the element's preferred width. The existing max-width: 100% in the ImageWrapper styled-component cannot constrain the wrapper because 100% of the already-expanded cell is also 1920px. Changing to width: min(Npx, 100%) breaks the expansion: during auto table layout the browser resolves 100% against the table's available width rather than the cell's inflated size, so the element's min-content contribution stays bounded and the cell no longer grows beyond its share of the table width. Fixes #12866 Co-authored-by: tsushanth <t.sushanth@gmail.com>