如何预防IntelliJ';从删除缩进中删除JavaDoc格式

如何预防IntelliJ';从删除缩进中删除JavaDoc格式,java,intellij-idea,javadoc,Java,Intellij Idea,Javadoc,下面是我写的javadoc评论: /** * This utility allows the user to do the following. * <ul> * <li>A cool feature</li> * <li>Another cool feature</li> * </ul> */ public static void main(String[] args)

下面是我写的javadoc评论:

  /**
   * This utility allows the user to do the following.
   * <ul>
   *   <li>A cool feature</li>
   *   <li>Another cool feature</li>
   * </ul>
   */
  public static void main(String[] args) {
/**
*此实用程序允许用户执行以下操作。
*
    *
  • 很酷的功能
  • *
  • 另一个很酷的功能
  • *
*/ 公共静态void main(字符串[]args){
这是同样的评论,由intelliJ重新格式化

  /**
   * This utility allows the user to do the following.
   * <ul>
   * <li>A cool feature</li>
   * <li>Another cool feature</li>
   * </ul>
   */
  public static void main(String[] args) {
/**
*此实用程序允许用户执行以下操作。
*
    *
  • 很酷的功能
  • *
  • 另一个很酷的功能
  • *
*/ 公共静态void main(字符串[]args){
如何防止自动格式化功能破坏我的意图


为了防止IntelliJ删除我的换行符,我选中了一个框:

设置>编辑器>代码样式>Java>JavaDoc>保存换行符


我希望有一个“前置空白”框位于同一位置,但没有。请尝试此答案中的建议实际上,删除空格/缩进适用于Javadocs for IntellJ中的任何内容。例如,如果您在Javadocs中有带有正确缩进的源代码的
片段,IntelliJ会清除空格。向上投票选择“保留前导空格”复选框。谷歌搜索有助于我的
案例-请参阅。如果使用
@code
标记,IntelliJ不会删除空格。但此HTML案例仍然保留,因为它不是代码的一部分,而是富文本格式。