2

Suppose I have Javadoc comment with:

 /** 
  * <ul>
  *   <li>stuff</li>
  *   <li>stuff</li>
  * </ul>
  */

When I run any of the eclipse formatting methods on this text, either as "Format Element" or "Format the selected Text", it removes the indenting of the HTML sub-elements and I get:

  /**
   * <ul>
   * <li>stuff</li>
   * <li>stuff</li>
   * </ul>
   */

Depending on list complexity, the result is much harder to read than the indented version.

Is there a means to instruct eclipse to be kinder to HTML tag indenting other than completely stopping it to format Javadoc?

2
  • I'm not sure whether it still works but have you checked this other question? Commented Feb 7 at 11:40
  • Yes, I saw it, but it is a bit extreme. As eclipse also knows how to indent (format, line-wrap, etc.?) HTML, I was hoping for it to apply it to Javadoc too. Also I am not a big fan of littering the code with IDE specific idioms. The next day I want to use something else or a co-worker uses it and the @formatter:off is suddenly pure cruft. But, well, I may use it as a last resort. Commented Feb 7 at 16:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.