google / google-java-format

Reformats Java source code to comply with Google Java Style.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

formatting is removing the <p> from the source code file

jagdeepjain opened this issue · comments

/**
 * <p>
 * File details.
 * </p>
 *
 * <p>
 * Usage of this file.
 * </p>
 *
 */
public class FormattingIssue {
}

Above class after formatting removes the first paragraph tag in the code.

/**
 * File details.
 *
 * <p>Usage of this file.
 *
 */
public class FormattingIssue {}

Is there any other way to fix this issue? I am using v2.5.1.

           <plugin>
                <groupId>com.coveo</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>2.5.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Is this really an issue? Isn't that how you're supposed to write javadoc?

Javadoc conventions are not the same as valid XHTML. It's meant to be kept as lean and readable as possible, since that's still not very lean or readable.

The opening 'summary fragment' in javadoc shouldn't have a <p> tag, and closing </p> tags are not required

Related: #61, https://stackoverflow.com/a/33787857

Thanks @cushon @kevinb9n @tbroyer my bad not looking into this before reporting the issue.