Some time passed since this was asked / answered and helped me clarify the following answer, hopefully additionally useful. I use this alternative since I wanted to run Javascript in Javadocs.
Eclipse provides @formatter: off and @formatter: for which you need to enable via Windows-> Preferences-> java-> code style-> formatter: edit button: tab "off / on tags", They can be used in any comments.
Around the doc document
// @formatter:off /** * javadoc */ // @formatter:on
But if you want the formatter in javadoc to use @formatter: xxx in the html <!-- xxxxx --> comments to indicate what you are trying to do. Use <code>...</code> bloack to not format and include code as javascript.
Changed the code instructions in the example since I wanted this to work on eclipse and netbeans. I found the formatter: off, but then stopped working on another version of eclipse (yes, I use several versions of the IDE).
/** * <br> * <code> * <script type="text/javascript"> * // hash structure for holding variable as name and its text * var hashText = {}; * * // function causes a hyper-link to be created * function insertLink(varName, text){ * var link22; * * hashText[varName] = text; * * link22 = '<a href="./ConsoleCapture.html#' + varName + '">' + hashText[varName] + '</a>'; * * document.write(link22); * } * function insertLinkA(varName){ * var link22; * * link22 = '<a href="./ConsoleCapture.html#' + varName + '">' + hashText[varName] + '</a>'; * * document.write(link22); * } * * function setLinkPoint(varName, text){ * hashText[varName] = text; * * document.write('<a id="' + varName + '"><U>' + hashText[varName] + '</U></a>'); * } * * function setLinkPointA(varName){ * document.write('<a id="' + varName + '"><U>' + hashText[varName] + '</U></a>'); * } * </script> * <code> * * * */
user3528877
source share