Skip to content

Commit d3f17cd

Browse files
kluevergoogle-java-format Team
authored andcommitted
Add a[]
This test demonstrates that `google-java-format` currently adds two extra blank lines before a Javadoc comment that begins with a `<table>` tag. PiperOrigin-RevId: 945727886
1 parent ff77a3c commit d3f17cd

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,6 +2150,29 @@ class Test {}
21502150
doFormatTest(input, expected);
21512151
}
21522152

2153+
@Test
2154+
public void tableAtStartOfComment() {
2155+
assume().that(MARKDOWN_JAVADOC_SUPPORTED).isTrue();
2156+
String input =
2157+
"""
2158+
/// <table>
2159+
/// <tr><td>Foo</td></tr>
2160+
/// </table>
2161+
class Test {}
2162+
""";
2163+
// TODO(kak): we shouldn't spew out these 2 leading blank lines
2164+
String expected =
2165+
"""
2166+
///
2167+
///
2168+
/// <table>
2169+
/// <tr><td>Foo</td></tr>
2170+
/// </table>
2171+
class Test {}
2172+
""";
2173+
doFormatTest(input, expected);
2174+
}
2175+
21532176
// TODO: b/346668798 - Test the following Markdown constructs, and make the tests work as needed.
21542177
// We can assume that the CommonMark parser correctly handles Markdown, so the question is whether
21552178
// they are subsequently mishandled by our formatting logic. So for example the CommonMark parser

0 commit comments

Comments
 (0)