Skip to content

Commit

Permalink
fix: default html img resize if no height included (#1065)
Browse files Browse the repository at this point in the history
* fix: default html img resize if no height included

* chore: adjust render test to not expect height
  • Loading branch information
maubuz committed May 18, 2020
1 parent a117b2a commit 9ff4d06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/render/compiler/image.js
Expand Up @@ -22,7 +22,7 @@ export const imageCompiler = ({ renderer, contentBase, router }) =>
if (height) {
attrs.push(`width="${width}" height="${height}"`);
} else {
attrs.push(`width="${width}" height="${width}"`);
attrs.push(`width="${width}"`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/render.test.js
Expand Up @@ -168,7 +168,7 @@ text

expectSameDom(
output,
'<p><img src="http://imageUrl" data-origin="http://imageUrl" alt="alt text" width="50" height="50" /></p>'
'<p><img src="http://imageUrl" data-origin="http://imageUrl" alt="alt text" width="50" /></p>'
);
});
});
Expand Down

0 comments on commit 9ff4d06

Please sign in to comment.