Skip to content

Commit

Permalink
Fixes missing "border-left" in regexp.
Browse files Browse the repository at this point in the history
Unit tests updated to test all border options.
  • Loading branch information
tubalmartin committed Mar 18, 2012
1 parent 6e2bc23 commit 84339cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ports/js/cssmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ YAHOO.compressor.cssmin = function (css, linebreakpos) {
css = this._compressHexColors(css);

// border: none -> border:0
css = css.replace(/(border|border-top|border-right|border-bottom|border-right|outline|background):none(;|\})/gi, function(all, prop, tail) {
css = css.replace(/(border|border-top|border-right|border-bottom|border-left|outline|background):none(;|\})/gi, function(all, prop, tail) {
return prop.toLowerCase() + ":0" + tail;
});

Expand Down
7 changes: 6 additions & 1 deletion tests/border-none.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ a {
border: none;
}
b {BACKGROUND:none}
s {border-top: none;}
s {
border-top: none;
border-right: none;
border-bottom:none;
border-left: none
}
2 changes: 1 addition & 1 deletion tests/border-none.css.min
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a{border:0}b{background:0}s{border-top:0}
a{border:0}b{background:0}s{border-top:0;border-right:0;border-bottom:0;border-left:0}

0 comments on commit 84339cf

Please sign in to comment.