diff --git a/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-extensions.ts b/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-extensions.ts index 6deada4d943..653b47c2f71 100644 --- a/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-extensions.ts +++ b/src/renderer/src/components/editor/rich-markdown/schema/rich-markdown-extensions.ts @@ -125,13 +125,15 @@ export function createRichMarkdownExtensions({ return ({ node, HTMLAttributes, editor }) => { // A wrapper prevents native image-byte dragging from conflicting with ProseMirror’s schema-node relocation. const dom = document.createElement('span') - // Keep the image wrapper inline so it cannot break surrounding text onto separate lines. - dom.style.display = 'inline-block' + // Inline, not inline-block: a shrink-to-fit wrapper collapses an SVG that has a viewBox but no width to 0×0. + dom.style.display = 'inline' dom.style.lineHeight = '0' - dom.style.maxWidth = '100%' const img = document.createElement('img') img.draggable = false + // Undo preflight's block, middle-aligned images so text keeps flowing around them as before. + img.style.display = 'inline-block' + img.style.verticalAlign = 'baseline' let renderedAttributeNames = new Set() const syncImageAttributes = (attributes: Record): void => { const nextNames = new Set()