File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -107,16 +107,12 @@ export default function DocImage({
107107 // If either width or height is specified manually, ignore any hash dimensions entirely
108108 const isManual = manualWidth != null || manualHeight != null ;
109109 const hashDimensions = isManual ? [ ] : parseDimensionsFromHash ( src ) ;
110- const width = isManual
111- ? manualWidth
112- : hashDimensions [ 0 ] > 0
113- ? hashDimensions [ 0 ]
114- : undefined ;
115- const height = isManual
116- ? manualHeight
117- : hashDimensions [ 1 ] > 0
118- ? hashDimensions [ 1 ]
119- : undefined ;
110+
111+ const inferredWidth = hashDimensions [ 0 ] > 0 ? hashDimensions [ 0 ] : undefined ;
112+ const width = isManual ? manualWidth : inferredWidth ;
113+
114+ const inferredHeight = hashDimensions [ 1 ] > 0 ? hashDimensions [ 1 ] : undefined ;
115+ const height = isManual ? manualHeight : inferredHeight ;
120116
121117 return (
122118 < ImageLightbox
You can’t perform that action at this time.
0 commit comments