Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8027552

The javadoc tool should remove a leading space if it exists

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd_major
    • Component/s: tools
    • Labels:

      Description

      Consider the javadoc to the String class:

          * Because String objects are immutable they can be shared. For example:
          * <p><blockquote><pre>
          * String str = "abc";
          * </pre></blockquote><p>
          * is equivalent to:

      The javadoc tool removes leading spaces and an asterisk.
      generates the following HTML:

       Because String objects are immutable they can be shared. For example:
       <p><blockquote><pre>
           String str = "abc";
       </pre></blockquote><p>
       is equivalent to:

      There is a leading space before the </pre> tag. It means that this line (with one invisible character) will be rendered.
      And resulting HTML will have a doubled empty space between paragraphs:
      http://docs.oracle.com/javase/7/docs/api/java/lang/String.html

      The reason of is the location of the </pre> tag.
      http://www.w3.org/TR/html401/struct/text.html#h-9.3.4

      The following code is rendered OK:
      <pre>one line</pre>

      The following code is rendered OK:
      <pre>
       first line
       second line
      </pre>

      The following code renders additional line:
       <pre>
       first line
       second line
       </pre>

      I think we should fix the javadoc tool and remove a space after an asterisk too.
      As a bonus we make html-files smaller.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              malenkov Sergey Malenkov (Inactive)
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: