RFR: 8277026: Remove blank lines remaining from snippet markup
Jonathan Gibbons
jjg at openjdk.java.net
Tue Nov 30 21:17:06 UTC 2021
On Tue, 30 Nov 2021 19:47:35 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
> This PR proposes to omit lines from the snippet source if those lines consist only of markup and perhaps whitespace. For example, if this PR is integrated, these three snippets will result in the same output:
>
> // @start region="example1"
> if (v.isPresent()) {
> System.out.println("v: " + v.get());
> } // @end
>
>
> if (v.isPresent()) { // @start region="example2"
> System.out.println("v: " + v.get());
> } // @end
>
>
> // @start region="example3" :
> if (v.isPresent()) {
> System.out.println("v: " + v.get());
> // @end :
> }
>
> While this change complicates the mental model for markup, it removes otherwise unavoidable inner blank lines in properties files, for example:
>
> coffee=espresso
> # @highlight:
> tea=ice
Nice.
I guess I was more expecting to filter output lines, rather than mark up input lines, but so far, I can't think of a problem case where they might be different. I have a couple of comments/questions about comment text, but no issues with the code. I look forward to using this in practice.
-------------
Marked as reviewed by jjg (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6623
More information about the javadoc-dev
mailing list