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

Jonathan Gibbons jjg at openjdk.org
Tue Jan 30 21:20:37 UTC 2024


On Thu, 25 Jan 2024 12:41:02 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java line 1388:
>> 
>>> 1386:          * @see <a href="https://spec.commonmark.org/0.30/#thematic-breaks">Thematic Break</a>
>>> 1387:          */
>>> 1388:         THEMATIC_BREAK(Pattern.compile("((\\+[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")),
>> 
>> Suggestion:
>> 
>>         /**
>>          * Thematic break: a line of * - _ interspersed with optional spaces and tabs
>>          * @see <a href="https://spec.commonmark.org/0.30/#thematic-breaks">Thematic Break</a>
>>          */
>>         THEMATIC_BREAK(Pattern.compile("((\*[ \t]*+){3,})|((-[ \t]*+){3,})|((_[ \t]*+){3,})")),
>
> To add to my earlier [comment], DocCommentParser recognises THEMATIC_BREAK consisting of `-` as SETEXT_UNDERLINE. While it's inaccurate, it doesn't seem important, as DCP's goal is to recognise and avoid Markdown, not process it.
> 
> [comment]: https://github.com/openjdk/jdk/pull/16388/files#r1462148038

Added lots more comment to the `LineKind` enum.

For the record, I would rephrase your statement about DCP's goal as follows: _DCP's goal is to recognize block boundaries when skipping over literal text, such as a code span; the specific kind of boundary generally does not matter._

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

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


More information about the build-dev mailing list