RFR: JDK-8298405: Support Markdown in Documentation Comments [v6]

Jonathan Gibbons jjg at openjdk.org
Mon Jan 29 23:38:31 UTC 2024


On Mon, 15 Jan 2024 12:30:09 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:
>> 
>>  - Merge with upstream/master
>>  - Merge remote-tracking branch 'upstream/master' into 8298405.doclet-markdown-v3
>>  - Address review comments
>>  - Fix whitespace
>>  - Improve handling of embedded inline taglets
>>  - Customize support for Markdown headings
>>  - JDK-8298405: Support Markdown in Documentation Comments
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 215:
> 
>> 213:                  case '\n', '\r' -> {
>> 214:                      return newString(bp, p);
>> 215:                  }
> 
> Hm... this does not seem to be consistent with `newline` in `nextChar`; should it be consistent?

I think it is OK, isn't it?

In both cases, a newline sequence can begin with `\r` or `\n`.

In this `peekLine` method, we only want the content up to but not including the newline, so there is no need to handle the possibility of `\r\n`.   In `nextChar`, we do want to detect `r` and `\r\n` and treat both as equivalent to `\n`.

Or am I missing something?

> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 241:
> 
>> 239:      * <li>{@code PREAMBLE}: the appearance of {@code <body>} (or {@code <main>}),
>> 240:      *      as determined by {@link #isEndPreamble()}
>> 241:      * <li>{@code BODY}: the beginning of a block tag, or when readung from
> 
> Suggestion:
> 
>      * <li>{@code BODY}: the beginning of a block tag, or when reading from

fixed

> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 249:
> 
>> 247:      *
>> 248:      *
>> 249:      *
> 
> Suggestion:

fixed

> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1000:
> 
>> 998:      * <li>cdata: {@code <![CDATA[ ... ]]>}
>> 999:      * </ul>
>> 1000:      *  or
> 
> Dangling "or".

Oops. fixed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470367971
PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470369401
PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470368948
PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1470368478


More information about the build-dev mailing list