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

Jonathan Gibbons jjg at openjdk.org
Tue Jan 30 22:15:34 UTC 2024


On Mon, 22 Jan 2024 16:57:16 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/parser/DocCommentParser.java line 1377:
> 
>> 1375:          * @see <a href="https://spec.commonmark.org/0.30/#atx-headings">ATX Headings</a>
>> 1376:          */
>> 1377:         ATX_HEADER(Pattern.compile("#{1,6}( .*|$)")),
> 
> Actually, I wonder how accurate those regexes should match spec. Given the definition [^*] of an ATX header and the fact that we always match the complete (not find inside) a line, which by definition should not have line terminators, shouldn't it be like this?
> 
>     #{1,6}([ \t]+.*)?
> 
> [^*]: The opening sequence of # characters must be followed by spaces or tabs, or by the end of line.

The spec says:

> The opening sequence of # characters must be followed by spaces or tabs, or by the end of line. 

so we're both slightly wrong. :-)

I will fix to `"#{1,6}([ \t].*|$)"))`

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

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


More information about the compiler-dev mailing list