We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e984fa commit 4616349Copy full SHA for 4616349
src/components/text-editor/prosemirror-adapter/plugins/image/node.ts
@@ -119,11 +119,16 @@ function createImageNodeSpec(language: Languages): NodeSpec {
119
{
120
tag: 'img',
121
getAttrs: (dom: HTMLElement): Attrs => {
122
+ let maxWidth = dom.style.maxWidth;
123
+ if (!maxWidth || maxWidth === 'none') {
124
+ maxWidth = '100%';
125
+ }
126
+
127
return {
128
src: dom.getAttribute('src') || '',
129
alt: dom.getAttribute('alt') || 'file',
130
width: dom.style.width || '',
- maxWidth: dom.style.maxWidth || '100%',
131
+ maxWidth: maxWidth,
132
state: ImageState.SUCCESS,
133
};
134
},
0 commit comments