mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
Improve comments stripping in compress
Ignore comment during compress if starts with exclamation mark
This commit is contained in:
@@ -8,7 +8,9 @@ tree.Comment = function (value, silent, index, currentFileInfo) {
|
||||
tree.Comment.prototype = {
|
||||
type: "Comment",
|
||||
toCSS: function (env) {
|
||||
return (env.compress || (this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced)) ? '' : this.value;
|
||||
var isReference = (this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced),
|
||||
isCompressed = env.compress && !this.value.match(/^\/\*!/);
|
||||
return (isReference || isCompressed) ? '' : this.value;
|
||||
},
|
||||
eval: function () { return this; },
|
||||
markReferenced: function () {
|
||||
|
||||
Reference in New Issue
Block a user