File tree Expand file tree Collapse file tree
core/src/test/java/com/google/googlejavaformat/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1988,6 +1988,30 @@ class Test {}
19881988 doFormatTest (input , expected );
19891989 }
19901990
1991+ @ Test
1992+ public void markdownTables () {
1993+ assume ().that (MARKDOWN_JAVADOC_SUPPORTED ).isTrue ();
1994+ String input =
1995+ """
1996+ /// | foo | bar |
1997+ /// | --- | --- |
1998+ /// | baz | qux |
1999+ ///
2000+ /// - |foo|bar|
2001+ /// |--:|:--|
2002+ /// |baz|qux|
2003+ class Test {}
2004+ """ ;
2005+ // TODO: unmangle the tables
2006+ String expected =
2007+ """
2008+ /// | foo | bar | | --- | --- | | baz | qux |
2009+ /// - |foo|bar| |--:|:--| |baz|qux|
2010+ class Test {}
2011+ """ ;
2012+ doFormatTest (input , expected );
2013+ }
2014+
19912015 // TODO: b/346668798 - Test the following Markdown constructs, and make the tests work as needed.
19922016 // We can assume that the CommonMark parser correctly handles Markdown, so the question is whether
19932017 // they are subsequently mishandled by our formatting logic. So for example the CommonMark parser
@@ -2027,4 +2051,10 @@ class Test {}
20272051 //
20282052 // - Autolinks
20292053 // <http://example.com> should be preserved. https://spec.commonmark.org/0.31.2/#autolink
2054+ //
2055+ // - Tables
2056+ // | foo | bar |
2057+ // | --- | --- |
2058+ // | baz | qux |
2059+ // Probably we should just try not to mangle them. https://spec.commonmark.org/0.31.2/#tables
20302060}
You can’t perform that action at this time.
0 commit comments