Closed GoogleCodeExporter closed 8 years ago
Have you seen the new white space indenting?
I can a Lisp like indenting strategy as a feature.
Original comment by adam.g...@evocatus.com
on 19 Nov 2011 at 4:03
Here is an example using a custom indenter to meet your needs:
@Test
public void testCustomIndenter() throws Exception {
final Indenter indenter = new SimpleIndenter("\n", "\t", "", "");
new Html(writer) {{
int i = 1;
indent(indentOff).html().body().indent(indenter);
table();
tr();
td().text("" + i++).end();
td().text("" + i++).end();
end();
tr();
td().text("" + i++).end();
endAll();
}};
String result = writer.getBuffer().toString();
String expected = "<html>\n" +
" <body>\n" +
" <table>\n" +
" <tr>\n" +
" <td>1</td>\n" +
" <td>2</td></tr>\n" +
" <tr>\n" +
" <td>3</td></tr></table></body></html>";
assertEquals(expected, result);
}
Original comment by adam.g...@evocatus.com
on 19 Nov 2011 at 5:12
Marking invalid since JATL already meets this need.
Original comment by adam.g...@evocatus.com
on 19 Nov 2011 at 5:17
Original issue reported on code.google.com by
x...@99jsj.com
on 31 Oct 2011 at 2:24