From 77966d44572b2bd8bb13400a12f6e36ed7cb0850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20O=C5=BEana?= Date: Wed, 27 Mar 2013 12:38:27 +0100 Subject: [PATCH] Improve comments stripping in compress Ignore comment during compress if starts with exclamation mark --- lib/less/tree/comment.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/less/tree/comment.js b/lib/less/tree/comment.js index 4da401f9..360c4119 100644 --- a/lib/less/tree/comment.js +++ b/lib/less/tree/comment.js @@ -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 () {