@@ -45,9 +45,13 @@ function genFragment(
45
45
) {
46
46
const entityConfig = { } ;
47
47
entityConfig . src = node . getAttribute ? node . getAttribute ( 'src' ) || node . src : node . src ;
48
+ entityConfig . alt = node . alt ;
48
49
entityConfig . height = node . style . height ;
49
50
entityConfig . width = node . style . width ;
50
- const entityId = Entity . create (
51
+ if ( node . style . float ) {
52
+ entityConfig . alignment = node . style . float ;
53
+ }
54
+ const entityId = Entity . __create (
51
55
'IMAGE' ,
52
56
'MUTABLE' ,
53
57
entityConfig ,
@@ -63,7 +67,7 @@ function genFragment(
63
67
entityConfig . src = node . src ;
64
68
entityConfig . height = node . height ;
65
69
entityConfig . width = node . width ;
66
- const entityId = Entity . create (
70
+ const entityId = Entity . __create (
67
71
'EMBEDDED_LINK' ,
68
72
'MUTABLE' ,
69
73
entityConfig ,
@@ -115,7 +119,6 @@ function genFragment(
115
119
const sibling = child . nextSibling ;
116
120
child = sibling ;
117
121
}
118
-
119
122
return { chunk } ;
120
123
}
121
124
@@ -135,9 +138,11 @@ export default function htmlToDraft(html: string): Object {
135
138
if ( chunkData ) {
136
139
const { chunk } = chunkData ;
137
140
let entityMap = new OrderedMap ( { } ) ;
138
- // chunk.entities && chunk.entities.forEach(entity => {
139
- // entityMap = entityMap.set(entity, Entity.get(entity));
140
- // });
141
+ chunk . entities && chunk . entities . forEach ( entity => {
142
+ if ( entity ) {
143
+ entityMap = entityMap . set ( entity , Entity . __get ( entity ) ) ;
144
+ }
145
+ } ) ;
141
146
let start = 0 ;
142
147
return {
143
148
contentBlocks : chunk . text . split ( '\r' )
0 commit comments