Remove source file comments using IntelliJ?

You can use the “Replace” (or “Replace in Path” if you want to remove comments in multiple files) in the regular expression mode and then use this regular expression in the “Text to find” field: (/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/|[ \t]*//.*) and replace it with an empty string. Then press “All” to apply this replacement to the entire file … Read more

/** and /* in Java Comments

The first form is called Javadoc. You use this when you’re writing formal APIs for your code, which are generated by the javadoc tool. For an example, the Java 7 API page uses Javadoc and was generated by that tool. Some common elements you’d see in Javadoc include: @param: this is used to indicate what … Read more

Is it possible to get reference to comment element/block by JavaScript?

var findComments = function(el) { var arr = []; for(var i = 0; i < el.childNodes.length; i++) { var node = el.childNodes[i]; if(node.nodeType === 8) { arr.push(node); } else { arr.push.apply(arr, findComments(node)); } } return arr; }; var commentNodes = findComments(document); // whatever you were going to do with the comment… console.log(commentNodes[0].nodeValue);

Conditional comment for ‘Except IE8’?

there’s some JS that I want to load for all browsers EXCEPT IE8, what conditional comment should I use? For something to appear in ‘other browsers’ that don’t support CCs, you need a downlevel-revealed conditional comment. <!–[if !IE 8]><!–> …. <!–<![endif]–> (this is slightly different to Microsoft’s official syntax which is not valid HTML.) “All … Read more