Skip to content

Commit ab500c2

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: 945715937
1 parent ff77a3c commit ab500c2

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

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

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

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

0 commit comments

Comments
 (0)