From dc71a7ce62fd15e12c03e3630ce409716872c8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89amonn=20McManus?= Date: Tue, 21 Jul 2026 14:57:38 -0700 Subject: [PATCH] Add a test that confirms the buggy behaviour from b/534219145. Blank lines before Markdown lists get deleted. PiperOrigin-RevId: 951715112 --- .../java/JavadocFormattingTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java b/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java index 8caab7187..967adf2fd 100644 --- a/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java +++ b/core/src/test/java/com/google/googlejavaformat/java/JavadocFormattingTest.java @@ -2004,6 +2004,32 @@ class Test {} doFormatTest(input, expected); } + @Test + public void markdownListPrecedingBlankLine() { + assume().that(MARKDOWN_JAVADOC_SUPPORTED).isTrue(); + String input = + """ + /// Title. + /// + /// Some paragraph. + /// + /// - Item 1. + /// - Item 2. + class Test {} + """; + // TODO(b/534219145): The blank line before the list should be preserved. + String expected = + """ + /// Title. + /// + /// Some paragraph. + /// - Item 1. + /// - Item 2. + class Test {} + """; + doFormatTest(input, expected); + } + @Test public void markdownBlockQuotes() { assume().that(MARKDOWN_JAVADOC_SUPPORTED).isTrue();