Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
clean up attribute value if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Apr 14, 2014
1 parent 28891b8 commit bc60f1c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ var urlResolver = {
url = url || node.ownerDocument.baseURI;
URL_ATTRS.forEach(function(v) {
var attr = node.attributes[v];
if (attr && attr.value &&
(attr.value.search(URL_TEMPLATE_SEARCH) < 0)) {
var replacement;
var value = attr && attr.value;
var replacement;
if (value && value.search(URL_TEMPLATE_SEARCH) < 0) {
if (v === 'style') {
replacement = replaceUrlsInCssText(attr.value, url, CSS_URL_REGEXP);
replacement = replaceUrlsInCssText(value, url, CSS_URL_REGEXP);
} else {
replacement = resolveRelativeUrl(url, attr.value);
replacement = resolveRelativeUrl(url, value);
}
attr.value = replacement;
}
Expand Down

0 comments on commit bc60f1c

Please sign in to comment.