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

Pavel Rappo prappo at openjdk.org
Mon Feb 12 15:30:10 UTC 2024


On Tue, 30 Jan 2024 23:15:32 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> 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.

I can see that you have fixed it to recognise lists `+` and thematic breaks `_`; good.

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

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


More information about the compiler-dev mailing list