@@ -170,18 +170,18 @@ export function parseAttributesString(attributes: string): { [key: string]: stri
170
170
* @param element
171
171
*/
172
172
export function lockImageSize ( element : HTMLElement ) {
173
- [ ] . slice . call ( element . querySelectorAll ( ' img' ) ) . forEach ( ( image : HTMLImageElement ) => {
173
+ [ ] . slice . call ( element . querySelectorAll ( " img" ) ) . forEach ( ( image : HTMLImageElement ) => {
174
174
if ( image . style . width . length === 0 ) {
175
- image . style . width = / ^ \d + $ / . test ( image . getAttribute ( ' width' ) ) ?
176
- image . getAttribute ( ' width' ) + 'px' :
177
- image . getAttribute ( ' width' ) ;
178
- image . setAttribute ( ' data-width-locked' , ' true' ) ;
175
+ image . style . width = / ^ \d + $ / . test ( image . getAttribute ( " width" ) ) ?
176
+ image . getAttribute ( " width" ) + "px" :
177
+ image . getAttribute ( " width" ) ;
178
+ image . setAttribute ( " data-width-locked" , " true" ) ;
179
179
}
180
180
if ( image . style . height . length === 0 ) {
181
- image . style . height = / ^ \d + $ / . test ( image . getAttribute ( ' height' ) ) ?
182
- image . getAttribute ( ' height' ) + 'px' :
183
- image . getAttribute ( ' height' ) ;
184
- image . setAttribute ( ' data-height-locked' , ' true' ) ;
181
+ image . style . height = / ^ \d + $ / . test ( image . getAttribute ( " height" ) ) ?
182
+ image . getAttribute ( " height" ) + "px" :
183
+ image . getAttribute ( " height" ) ;
184
+ image . setAttribute ( " data-height-locked" , " true" ) ;
185
185
}
186
186
} ) ;
187
187
}
@@ -192,14 +192,14 @@ export function lockImageSize(element: HTMLElement) {
192
192
* @param element
193
193
*/
194
194
export function unlockImageSize ( element : HTMLElement ) {
195
- [ ] . slice . call ( element . querySelectorAll ( ' img' ) ) . forEach ( ( image : HTMLImageElement ) => {
196
- if ( image . getAttribute ( ' data-width-locked' ) ) {
195
+ [ ] . slice . call ( element . querySelectorAll ( " img" ) ) . forEach ( ( image : HTMLImageElement ) => {
196
+ if ( image . getAttribute ( " data-width-locked" ) ) {
197
197
image . style . width = null ;
198
- image . removeAttribute ( ' data-width-locked' ) ;
198
+ image . removeAttribute ( " data-width-locked" ) ;
199
199
}
200
- if ( image . getAttribute ( ' data-height-locked' ) ) {
200
+ if ( image . getAttribute ( " data-height-locked" ) ) {
201
201
image . style . height = null ;
202
- image . removeAttribute ( ' data-height-locked' ) ;
202
+ image . removeAttribute ( " data-height-locked" ) ;
203
203
}
204
204
} ) ;
205
205
}
0 commit comments