Skip to content

Commit 188ac67

Browse files
Hanif Nur Amrullahsstur
authored andcommitted
Update stateFromElement.js (sstur#178)
Img tags with "width" defined is missing the attribute when imported
1 parent 445352c commit 188ac67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/draft-js-import-element/src/stateFromElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const DATA_ATTRIBUTE = /^data-([a-z0-9-]+)$/;
109109
// Map element attributes to entity data.
110110
const ELEM_ATTR_MAP = {
111111
a: {href: 'url', rel: 'rel', target: 'target', title: 'title'},
112-
img: {src: 'src', alt: 'alt'},
112+
img: {src: 'src', alt: 'alt', width: 'width', height: 'height'},
113113
};
114114

115115
const getEntityData = (tagName: string, element: DOMElement) => {

0 commit comments

Comments
 (0)