File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,24 @@ export default class HTMLImage extends PureComponent {
49
49
if ( width ) {
50
50
styleWidth = width ;
51
51
}
52
- style . forEach ( ( styles ) => {
53
- if ( ! width && styles [ 'width' ] ) {
54
- styleWidth = styles [ 'width' ] ;
52
+ if ( Array . isArray ( style ) ) {
53
+ style . forEach ( ( styles ) => {
54
+ if ( ! width && styles [ 'width' ] ) {
55
+ styleWidth = styles [ 'width' ] ;
56
+ }
57
+ if ( ! height && styles [ 'height' ] ) {
58
+ styleHeight = styles [ 'height' ] ;
59
+ }
60
+ } ) ;
61
+ } else {
62
+ if ( ! width && style [ 'width' ] ) {
63
+ styleWidth = style [ 'width' ] ;
55
64
}
56
- if ( ! height && styles [ 'height' ] ) {
57
- styleHeight = styles [ 'height' ] ;
65
+ if ( ! height && style [ 'height' ] ) {
66
+ styleHeight = style [ 'height' ] ;
58
67
}
59
- } ) ;
68
+ }
69
+
60
70
return { styleWidth, styleHeight } ;
61
71
}
62
72
You can’t perform that action at this time.
0 commit comments