Skip to content

Commit

Permalink
Fix IE8 <img> parser bug, add gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Blum committed Jun 30, 2011
1 parent 6ee1618 commit 64b67e3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.tm_sync.config
11 changes: 11 additions & 0 deletions dist/wysihtml5-0.1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -5500,6 +5500,17 @@ wysihtml5.utils.sanitizeHTML = (function() {
newNode.setAttribute(attributeName, attributes[attributeName]);
} catch(e) {}
}

// IE8 sometimes loses the width/height attributes when those are set before the "src"
// so we make sure to set them again
if (attributes.src) {
if (typeof(attributes.width) !== "undefined") {
newNode.setAttribute("width", attributes.width);
}
if (typeof(attributes.height) !== "undefined") {
newNode.setAttribute("height", attributes.height);
}
}
}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/utils/sanitize_html.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,17 @@ wysihtml5.utils.sanitizeHTML = (function() {
newNode.setAttribute(attributeName, attributes[attributeName]);
} catch(e) {}
}

// IE8 sometimes loses the width/height attributes when those are set before the "src"
// so we make sure to set them again
if (attributes.src) {
if (typeof(attributes.width) !== "undefined") {
newNode.setAttribute("width", attributes.width);
}
if (typeof(attributes.height) !== "undefined") {
newNode.setAttribute("height", attributes.height);
}
}
}

/**
Expand Down

0 comments on commit 64b67e3

Please sign in to comment.