Skip to content

Commit 9ff4d06

Browse files
authored
fix: default html img resize if no height included (#1065)
* fix: default html img resize if no height included * chore: adjust render test to not expect height
1 parent a117b2a commit 9ff4d06

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/core/render/compiler/image.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const imageCompiler = ({ renderer, contentBase, router }) =>
2222
if (height) {
2323
attrs.push(`width="${width}" height="${height}"`);
2424
} else {
25-
attrs.push(`width="${width}" height="${width}"`);
25+
attrs.push(`width="${width}"`);
2626
}
2727
}
2828

Diff for: test/unit/render.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ text
168168

169169
expectSameDom(
170170
output,
171-
'<p><img src="http://imageUrl" data-origin="http://imageUrl" alt="alt text" width="50" height="50" /></p>'
171+
'<p><img src="http://imageUrl" data-origin="http://imageUrl" alt="alt text" width="50" /></p>'
172172
);
173173
});
174174
});

0 commit comments

Comments
 (0)