-
-
Save kostasx/c3ba2d8912320300e1e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(RGX_COMMENT, RGX_TRIM) { | |
getComments = function (fn, opt_trim) { | |
var comments = []; | |
(fn + '').replace(RGX_COMMENT, function(m, a, b, c) { | |
if (!c) { | |
m = a == undefined ? b : a; | |
comments.push(opt_trim ? m.replace(RGX_TRIM, '') : m); | |
} | |
}); | |
return comments; | |
}; | |
})(/\/\*([\s\S]*?)\*\/|(?:<\!--|\/\/)([^\r\n]*)|(["'])(?:[^\\\3]+|\\[\s\S])+\3/g, /^[\s\xA0]+|[\s\xA0]+$/g); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment