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

Jonathan Gibbons jjg at openjdk.org
Tue Jan 30 23:18:15 UTC 2024


On Wed, 24 Jan 2024 16:30:50 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 pull request now contains eight commits:
>> 
>>  - Merge with upstream/master
>>  - 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/tree/DocTreeMaker.java line 790:
> 
>> 788: 
>> 789:         // end of paragraph is newline, followed by a blank line or the beginning of the next block
>> 790:         private static final Pattern endPara = Pattern.compile("\n(([ \t]*\n)|( {0,3}[-+*#=]))");
> 
> So DocTreeMaker now also knows about Markdown. I wonder if we can avoid that. Also, I assume you mean this (`+` is not a part of "thematic break"):
> Suggestion:
> 
>         private static final Pattern endPara = Pattern.compile("\n(([ \t]*\n)|( {0,3}[-_*#=]))");

The code is doing its best to model the non-Markdown behavior, which is to detect paragraph breaks, which terminate the first sentence in the absence of any period.

`+` is in the pattern as a list marker; I added `_` for thematic break, and added more comments.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1472103907


More information about the build-dev mailing list