Skip to content
Snippets Groups Projects
Commit 7f186bd3 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #504 from greezybacon/issue/images-width-0


Ensure images, when initially placed, have a width

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents c920fc00 058aa842
No related branches found
No related tags found
No related merge requests found
......@@ -126,8 +126,9 @@ $(function() {
// TODO: Rewrite the entire <img> tag. Otherwise the @width
// and @height attributes will begin to accumulate
before = img.outerHTML;
$(img).attr('width', img.clientWidth)
.attr('height',img.clientHeight);
if (img.clientWidth && img.clientHeight)
$(img).attr('width', img.clientWidth)
.attr('height',img.clientHeight);
html = html.replace(before, img.outerHTML);
});
// Drop <inline> elements if found in the text (shady mojo happening
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment